Combo Box Options based on another Combo Box Selection (1 Viewer)

stephen81

Registered User.
Local time
Today, 06:39
Joined
Nov 27, 2002
Messages
198
I have a form (Form1) with two combo boxes (Combo1 and Combo2). Both have their Row Sources as queries based on the same reference table (tbl1). For ease, I'll say the table has two columns as below.

Col1 Col2
1 A
2 B
3 B
4 A
5 B

The first combo box has a row source
Code:
SELECT DISTINCT tbl1.Col2 FROM tbl1;

and the second has row source
Code:
SELECT tbl1.Col1
FROM tbl1
WHERE (((tbl1.Col2)=[Forms]![Form1]![Combo1])) 
OR ((([Forms]![Form1]![Combo1]) Is Null));

The idea being that the user can make a selection in the first combo box which will narrow down the options in the second combo box.

This works fine when the form is first opened, but once the second combo box list has been displayed, changing what is in the first combo box makes no difference to the available options in the second one.
Is there a way of getting the second box to requery it's row source when the first box is changed?
 

KenHigg

Registered User
Local time
Today, 01:39
Joined
Jun 9, 2004
Messages
13,327
Did you do a me!cbo2.requery in the cbo1 after update event?


???
ken
 

stephen81

Registered User.
Local time
Today, 06:39
Joined
Nov 27, 2002
Messages
198
Perfect. Thanks Ken.
 

Users who are viewing this thread

Top Bottom