Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004

    Unanswered: Making use of relationships within vba?

    I'm very new to access programming (using vba) and have hit a pretty fundamental problem I can't seem to find an answer to!

    I like control, so ideally want to program the majority of my application using vba, including most of the form operations - rather than using wizards etc.

    What I really want to do is make values appear in textboxes within a form, based on information supplied by the user - i.e. user chooses customer ref. from a list box, for example, and additional data is displayed in-situ. Very easy to do using a wizard, but I don't know how to make use of the relationships between data, held within the base tables, to retrieve related info? For example, if I wanted to display the customer name, based on the customer Id, how would I use the customer ID to find the customer name within vba?

    I am very perplexed, I don't know if this makes much sense, but any help would be most appreciated.

  2. #2
    Join Date
    Jul 2004
    Actually it does make sense.. How much SQL do you know? I would STRONGLY suggest learning SQL before you attempt to program a front end in VBA, as ultimately you will need SQL to retrieve related records such as you are trying to do. You can perform an SQL statement using the docmd.runSQL command from within VBA. Provide a little more info as to what you are trying to do and I will help you with the SQL statement.

  3. #3
    Join Date
    Jul 2004

    A bit more info.

    I am basiclly writing an application to, at the lowest level take orders, but also perform all the steps throughout the life of the order, manufatcuring control, purchasing etc.

    I am quite good at designing databases, schemsa and keys and the like, but underestimated the intricacies of using this within an application.

    I have a little experience with VB, so thought I might be able to esssentially dodge the programming of forms and queries etc. and write the application primarily through code. But, the controls, and functions used within access vba are somewhat different, and hence will require alot of learning.

    My main aim is to use a combo/list box to select customers based on name, or ID no., then use this to populate other textboxes with related info, such as address etc. But I don't know how to make use of the relationships between, and within, tables to retrieve this related data?


  4. #4
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    poke around for "cascading combo boxes". That will get you the information you want, plus a little extra. Like how to populate a list of options based on a selection from a list of options.

    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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