By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,385 Members | 847 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,385 IT Pros & Developers. It's quick & easy.

Combo boxes dependent on other combo boxes

P: 5
This is what I am using to filter my combo box based on what is selected in the previous box.

Open the properties for the second combo box. Next to the 'Row Source' property, click on the '...'.

This opens the query related to the combo box.

In the criteria row under the category field, type the following:

[Forms]![Form1]![Combo1]

Where Form1 is the name of the form containing the combo boxes.

And, Combo1 is the name of the first combo box you have just made.

Change these names to suit your own database.

Close and save the query.

What I have is a main form and on this form, I have a subform. If I use the above...[Forms]![Subform]![Combo37] and try this from the subform, it works as expected. But, if I open the main form and try to use it, soon as I click on the second combo box I get a popup box stating "Enter Parameter Value" and it lists [Forms]![Subform]![Combo37]. How do I get this to work on my main form?
Apr 3 '07 #1
Share this Question
Share on Google+
5 Replies


Rabbit
Expert Mod 10K+
P: 12,365
To refer to a control on a subform you have to use:
Expand|Select|Wrap|Line Numbers
  1. [Forms]![Main Form]![Sub Form Control].Form.[Control Name]
Apr 3 '07 #2

P: 5
I am still getting the same results. What part of this code do i have to change to the subform name?
Apr 3 '07 #3

Rabbit
Expert Mod 10K+
P: 12,365
Let's make this clear.

On a form there are controls.
One such control is a subform object.
This object has a name and links another form that already exists.
This other form also has a name.
The name of the other form and the name of the subform object can be different.

So you want to use the subform control name and not the name of the other form when you're trying to refer to a control on a subform from the main form.
Apr 3 '07 #4

P: 5
Ok, thanks. That did make it a lot clearer. I was having trouble with the [Sub Form Control]. It works now.
Apr 3 '07 #5

Rabbit
Expert Mod 10K+
P: 12,365
Good Luck.
Apr 3 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.