displaying info based on selection from combo box

M

MRR

I have a subform with two combo boxes and I want the data displayed in the second box to be based on the selection from the first combo box. I am using a SQL statement in the record source with a WHERE statement to equate the two selections. This works fine when i open the subform on its own but when I open the main form where the subform is on a Tab control Page it no longer works. The subform is linked to the main form on an unique ID number. When I open the main form, I get a msg box asking me to enter a parameter value for the criteria statement. Any ideas?
 
W

woloman

Make sure the criteria in the SQL of your 2nd box is in
the format:

[forms]![frmNameOfForm]![cboCombo1]

Also, you may want to make sure there is an After Update
event in your 1st combo box that refreshes the 2nd if the
data is updated/changed:

Me.cboCombo2.Requery


-----Original Message-----
I have a subform with two combo boxes and I want the data
displayed in the second box to be based on the selection
from the first combo box. I am using a SQL statement in
the record source with a WHERE statement to equate the two
selections. This works fine when i open the subform on
its own but when I open the main form where the subform is
on a Tab control Page it no longer works. The subform is
linked to the main form on an unique ID number. When I
open the main form, I get a msg box asking me to enter a
parameter value for the criteria statement. Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top