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

Make a Combo in Subform follow a Combo in Main Form

Status
Not open for further replies.

Np02

Technical User
Mar 14, 2003
21
US
Hi,Everybody:

I have a Combo (Combo1) box in Main form. Inside this Main form, there is an unbound Combo (Combo2). I want the Combo2 to change and match the Combo1 data everytime I pick up a choice in Combo1. I tried using (Child Link (Combo2) and Master LInk (Combo1), but it doesn't work.

Anybody can help? Appreciate!

NP
 
There must be a data link between the data in the two combos - the second combo must be tied somehow to the selection in the first combo.
eg:
combo 1: Ford
Combo 2: Mondeo
Fiesta
Puma
Galaxy
The connection here is the Name which will be in the models table.
on after_update of combo1 requery combo 2.
in the query for combo 2 set the criteria in Manufacturer's Name to Forms!frmName!comboname

it's magic really!
 
Hi, Trendsetter:

I tried, but not working. Maybe I did not explain the question clear.
The combo1 is a bound Combo box in the Main form, has its data source from a field (ID) in Table1. Combo2 is in a subform(Subform1) that is inside the Main form. Combo2 is unbound and does not have a query for it. It gets data directly by Using "SELECT DISTINCT Table1.ID FROM Table1" in Row Source. (Control Source in Combo2 is empty). After getting your reply, I did try to put"=Forms![Main]![Combo1]" in Control Source of Combo2, but it does not work. Any advice?

NP02
 
Enter the following in the AfterUpdate Event of Combo1

[fomrs]![SubFormName![Combo2Name] = [Forms]![MainFormName]![Combo1Name]

Change the names as appropriate.
"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?"
 
Hi, Jfgambit:

Sorry getting back so late. Your code works. Thank you a lot.

NP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top