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.
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.
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?