View Full Version : Lookup wizard.


Manc
02-01-2010, 07:49 AM
Hi there

I have a customer table of 5 customers.
I have a contact table of 5 contacts for each customer.

I have a new table where you choose the customer from a drop down list using the lookup wizard. The next field is then "contacts". How can I limit the contacts displayed via drop down list, to only contacts that apply to that customer?

Any advice mucly appreciated.
Manc.

llkhoutx
02-01-2010, 06:52 PM
The contacts must be linked to the customers table, e.g.

tbCustomers
PKCustomer
Customer

tbContacts
PKContact
FKCustomer
Contact

In the relationships window, relate tbCustomers.PKCustomer to tbContacts.FKCustomer with cascading updates and deletes.

If displaying Customers on a form, contacts should be a related subform. changing customer with cause the contacts subform to tumble.

With the realtionship built, adding both tables to the query by design window, the two tables will be automatically joined. Select which fields you want to display.

Look at the query in the SQL view.

Manc
02-01-2010, 11:54 PM
Thanks llkhoutx

I'll give it a try