Results 1 to 4 of 4

Thread: Help needed - V V new to database with VB

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2002
    Location
    South West UK
    Posts
    245

    Help needed - V V new to database with VB

    Hi,

    I am extreemly new to using VB with databases. I have an access database with 5 tables. I am looking to create a user input screen in VB. The screen will have a drop down box which is populated from the names table, when selected various other textbowes are filled in from the other tables automatically. Does anyone out there have any notes on how i first link a drop down box to a database and for it to pull back the requiored field and then how to link the selected name so that all the other textboxes are populated from the remaining 4 tables. I know to you guys that this is simple stuff ("bread and butter") but as a newbie, i would really appreciate your time and help.

    Thank you in advance.
    A lowly programmer.

    http://www.sentinalgroup.com

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Do you want the RAD version (bound) or proper coding version (unbound)?

    How long do you have?


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2002
    Location
    South West UK
    Posts
    245
    prefer unbound as i believe its alot more flexible. I have till end of next week.
    A lowly programmer.

    http://www.sentinalgroup.com

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    You are working in vb?


    if so :
    Add in either ADO or ADOX or DAO references to the code.
    Create the form as you want it to view.

    To fill the combo box, you need to:
    - Clear the combo
    - Open a recordset
    - Loop through and store to the combo and possibly an array for other fields (you'll have to look into that) for use of filtering
    - close the recordset
    - clean up vars (set rst to nothing)

    On Click or On Change event, you open a recordset using the value in the combo, if it has one record, you fill the controls (text boxes) as applicable. I am at work I'll try to put up some vague code you can base on later when I'm at home.

    Please have a go first by yourself though. Better, as you will learn it

    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width