Value from one Combo Boxe in another!

johnyjassi

Registered User.
Local time
Today, 02:31
Joined
Jun 6, 2008
Messages
64
Hi Experts!
I have two combo boxes on my form, where in one it should be the company's name and in another one it should show the names of all the contact person's name in that company, like company name is one and contact name in that company could be 5. I is retrieving the value from one table. Each company name has a unique id(PK). I created a select query for first combo to retrieve the value(distinct) of company name, what should i do with the second one so it should show the contact names of company picked from first combo. Any help will be appreciated.

Thanks!
 
Have a search for "Cascading combo" in the reference part of the form and you will find some samples of what to do.

If you have trouble after looking at the samples post specific questions here.
 
I searched the "cascading combo box" in this forum. I found a very usefull answer to my question. I implemented it but when i choose a value from first combo box, the second combo box shows the values related to first one. but when i choose a value(say 3rd one) it shows the first one everytime. Any advice?
 
Did you "refresh" the second combobox upon change of the first??
 
I know how Cascading combo's work... Thank you very much !

Do you have code in your master Combo to requery the child Combo after update or on change??

In Bobs sample go into the design of the form Now right click the Employee Combo => Properties
Go to the "event" tab and click on the "Event Procedure" of the after update event.
This shows some "..." button to the right, click that...
The code you are now seeing "Me.cboAccountID.Requery" makes sure the combo boxes stay in sink.
 

Users who are viewing this thread

Back
Top Bottom