Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access - based on one form contrl, populate other fields from query 1

Status
Not open for further replies.

rxsims

Technical User
Jul 14, 2003
34
CA
Hi -

I need to be able to do the following:

1)Enter "customer #" in a form field/control
2)Hit a button to run code to complete form fields with address, city, phone number, etc. which comes from a "customer" table.

I would like to do this in vba instead of having a sub form (with a query record source) based on the "customer #" field in the form.

I am currently running a docmd.openquery to get the customer information (address, city, phone number, etc.) filtered by "customer #" field, but I can't figure out how to reference the field in the query, i.e.

forms.orders.CustomerAddress = query.customers.CustomerAddress

where the query.customers is the query I ran on the "customer" table.

Regards....
 
Why not simply use a ComboBox ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV - thanks for your quick response. It seems obvious to use a combo box now! I still need to select from the drop down menu for each field. It is easy now that there is only once choice to select (the drop down source is the query I used before. For each customer # there is only one option given in the drop down for address, city, phone #, etc.). How can I have the data from the field entered automatically without having to manually select?
 
You may use the Column property of the combo.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top