Results 1 to 10 of 10
  1. #1

    Default Microsoft Access VB help!


    Mga bro/sis, naa man gud ko gihimo na simple database ba then i need help on a few things. I asked these questions on Yahoo Answers pero wa kau ko kasabot sa ila mga tubag kay beginner pa lagi. hehehe. Pls. shed me some light mga bro/sis by posting here sa Istorya. I want to finish this by next week. Thanks in advance!

    http://answers.yahoo.com/question/in...4022654AAsjo5W

    http://answers.yahoo.com/question/in...4021924AAAJwhx

  2. #2

    Default Re: Microsoft Access VB help!

    For your #1 question, their answer is correct. You must create a new form with a textbox with the Input Mask (set at right-click/properties) to password. Then set the Form property and set the "On Open" event and add his code.

    For the #2 question.
    If your table has this ID field unique or set as Primary Key, any new record added with this ID duplicated will result to this error message. What you could do, as the poster suggested, is set it to Autonumber where MsAccess automatically assigns a number (last ID +1) thus preventing duplicates even on a multi-user environment. Another way, but much slower, is to find the maximum value of ID on the table and increment it by 1 and use this as the new ID.

  3. #3

    Default Re: Microsoft Access VB help!

    wow thanks bro! i'll try to input these in my database. hehe. mu.post lang ko balik if naa pako concerns.

    then naa pajud ko lain question mga bro/sis:

    naghimo ko og form na mu.display sa mga customers og sa ilang mga gipangpalit sa tindahan so far. para ana, i made two subforms. the first subform contains, in tabular form, their receipt numbers and dates. then the second subform contains, also in tabular form, the items they bought under the selected receipt number sa subform 1. unsaon man nako ni pag.connect ang two subforms na kung mu.select ko og receipt number sa subform 1, mugawas sa subform 2 ang mga items. what codes man should i use sa link master og child fields?

    please help me guys! thanks a lot in advance!


  4. #4

    Default Re: Microsoft Access VB help!

    [br]Posted on: April 24, 2008, 10:08:24 AM_________________________________________________
    Quote Originally Posted by cold_fusion
    For the #2 question.
    If your table has this ID field unique or set as Primary Key, any new record added with this ID duplicated will result to this error message. What you could do, as the poster suggested, is set it to Autonumber where MsAccess automatically assigns a number (last ID +1) thus preventing duplicates even on a multi-user environment. Another way, but much slower, is to find the maximum value of ID on the table and increment it by 1 and use this as the new ID.
    but bro manual man nako pagbutang sa ID number, not by autonumber. mura bag student ID number na mao kunohay primary key. hehehe. wla jud lain pamaagi bro na guman nako input sa ID number kay mu.check xa if existing ba then mu.return xa og msgbox error? ako nman pud gi set ang indexes (yes, no duplicates) pero unya rpud xa mu.error ig.switch napud nako sa lain na record. then murag technical pd kau ang words sa iyang error message (something like, you can't make changes because it would cause duplicates sa primary key or indexes) nya dili nya makasabot ani ang mga mugamit sa database kung unsa nay nahitabo. hehehe.

    bro murag nalisdan jud ko. please help me. heeheehee. =)

  5. #5
    Junior Member
    Join Date
    May 2007
    Gender
    Male
    Posts
    322

    Default Re: Microsoft Access VB help!


    I suggest bro to generate those id programmatically, ayaw na lng e allow ang user to input on ID, mag design na lang ka kun unsa ang format sa imo id, so prior saving the record to the table, mogenarate sa ka og ID for the current record then e save nimo ang record to table together sa id nga nagenerate. Just make sure to check that ang id nga nagenerate is not an existing one.


  6. #6

    Default Re: Microsoft Access VB help!

    Quote Originally Posted by LuFtWaFFe
    naghimo ko og form na mu.display sa mga customers og sa ilang mga gipangpalit sa tindahan so far. para ana, i made two subforms. the first subform contains, in tabular form, their receipt numbers and dates. then the second subform contains, also in tabular form, the items they bought under the selected receipt number sa subform 1. unsaon man nako ni pag.connect ang two subforms na kung mu.select ko og receipt number sa subform 1, mugawas sa subform 2 ang mga items. what codes man should i use sa link master og child fields?
    There must be a common field on both tables. For example, we name table1 "receipt" and table2 "receipt details". receipt table should contain a primary key such as Autonumber ID and "receipt details" contains ReceiptID that is not unique and where the Primary key of receipt/table1 is stored. Then use reciept.ID and [receipt details].ReceiptID as master and child fields, respectively, on your form/subform link properties.

  7. #7

    Default Re: Microsoft Access VB help!

    Quote Originally Posted by torade
    I suggest bro to generate those id programmatically, ayaw na lng e allow ang user to input on ID, mag design na lang ka kun unsa ang format sa imo id, so prior saving the record to the table, mogenarate sa ka og ID for the current record then e save nimo ang record to table together sa id nga nagenerate. Just make sure to check that ang id nga nagenerate is not an existing one.
    cge bro thanks! =)

  8. #8

    Default Re: Microsoft Access VB help!

    Quote Originally Posted by cold_fusion
    There must be a common field on both tables. For example, we name table1 "receipt" and table2 "receipt details". receipt table should contain a primary key such as Autonumber ID and "receipt details" contains ReceiptID that is not unique and where the Primary key of receipt/table1 is stored. Then use reciept.ID and [receipt details].ReceiptID as master and child fields, respectively, on your form/subform link properties.
    bro, when u said that there must be a common field between two tables, didn't you mean subforms? im confused kay ang master field nako kay tblCustomers man diba, since it is what this form is about, to display the purchases of a customer. so if ReceiptID ako ibutang sa link master field, wla may receipt number na field ang tblCustomers nako. puro rman details sa customer like address, etc ang naa didto. butangan pa2 nako og ReceiptID field? pero naa common field ang two subforms: ReceiptID. diba dapat ang master field nako kay ang subform1 then ang child field kay subform2, since mag.agad man ang table2 sa unsay gi.select na receipt number sa subform1, para ma.connect silang duha? sakto ba ko bro?..

    Nakakita pd ko og clue sa sample database that comes with MS Access then inani ang code na ilang gigamit didto para sa link master field: [Subform1].Form![ReceiptID]. then sa link child field kay ReceiptID na dritso. confused pud ko ani bro kay lahi man imo gi.suggest na code and gisuwayan pud ni nako ilang code then dili pud mu.work..

    help help help! huhuhu..

  9. #9

    Default Re: Microsoft Access VB help!

    Don't confuse forms, tables and fields.
    Forms is where you enter the data.
    Table is where data is stored.
    And field is the column on each table.
    A record is the row on the table.

    So tblCustomers is the table and not the field.

    In order the Form and subform linking to work, you need a parent field of one table and one child field of another table to be same. The parent field is unique while the child field is not (multiple entries possible).

    In your app, as I understand, is that you sould have 3 tables, Customers, Receipts and Receipt details. Customers contains the ID, cusomer name and address. Receipts the receipt contains ID, receipt#, date purchased and customerID. While [receipt details] will contain ReceiptID, item ordered, quantity and price.

    So the master field will be receipt.ID and child field will be [receipt details].receiptID.

    I think you should read well about "database normalization" in order to understand this correctly. It is difficult to explain but you can read it here http://en.wikipedia.org/wiki/Database_normalization for the specifics. Or google for more explanations.

  10. #10

    Default Re: Microsoft Access VB help!

    ahhh..cge bro thanks a lot for ur time and patience..i'll go check out ur link..heeheehee =)

  11.    Advertisement

Similar Threads

 
  1. Microsoft Access Training
    By cmac2 in forum Windows Software
    Replies: 1
    Last Post: 11-13-2012, 05:34 PM
  2. To all microsoft access expert
    By ISDA_SA_BATO in forum Programming
    Replies: 1
    Last Post: 05-18-2010, 02:50 PM
  3. network access problem. help.
    By reelMakoy in forum Networking & Internet
    Replies: 8
    Last Post: 09-29-2008, 08:31 AM
  4. unsa ni cya, virus?(imgkulot.vbs) help..
    By bless in forum Computer Hardware
    Replies: 6
    Last Post: 11-06-2007, 12:03 PM
  5. Microsoft Access error!
    By junaxM in forum Software & Games (Old)
    Replies: 5
    Last Post: 08-01-2006, 03:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top