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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate a field based on a combo box selection

Status
Not open for further replies.

BeallDon

Technical User
Aug 20, 2007
46
CA
I have a form for my Client table that has a combo box that selects a "creditor" from the Creditor table. I then have another combo box that selects a "contact" from the Contact table. There is a relationship built between the Creditor & Contact tables (creditorID). As it is, when I drop down the Contact combo box, it lists ALL contacts for ALL creditors - I would like to set up the Contact combo box to only display the Contacts that are relevant to the Creditor that has been selected.

Any advice would be appreciated!
 
Amend the rowsource of the contact combo box to be a query, based on the contact table, but with a criteria on the creditor column of = Comboboxname (use the bulider wizard to guide you through this, it will give you a criteria something like Forms!MyForm!MyComboboxname), in the on got focus even of the contacts combo box put code to requery the data eg MyContactCombobox.requery

You need to use the correct names of your forms and controls of course to replace the dummy names I have used

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top