Cascading Combo Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi - I have 2 combo boxes that I want to relate to each other. I set up and
sql expression to base the value from one combo to the other. It works fine
but if you want to revise your first combo choice the query doesn't reset.
It always returns the value in the second combo. I'm using the cascading
example below - of course the example does exactly what I want but when I
edit it doesn't reset. I checked the syntax many times and it appears to be
fine. Is there something I'm missing or haven't enabled.

http://www.rogersaccesslibrary.com/TableOfContents3.asp
 
John,

Please post the RowSource of the first combo box and its AfterUpdate
procedure.

Sprinks
 
Row Source for Table 1 - SELECT DISTINCT Table7.city FROM Table7;
Row Source for Combo 2 - SELECT DISTINCTROW Table7.zip FROM Table7 WHERE
(((Table7.city) Like forms!frmSimple!combo0));

I've edited the table and form to match my database and like I said it only
queries the first time it's accessed.
 
see code below for Row Source:

Row Source for Table 1 - SELECT DISTINCT Table7.city FROM Table7;
Row Source for Combo 2 - SELECT DISTINCTROW Table7.zip FROM Table7 WHERE
(((Table7.city) Like forms!frmSimple!combo0));

I've edited the table and form to match my database and like I said it only
queries the first time it's accessed.
 
You need to use the AfterUpdate Event of the first ComboBox to requery the
second ComboBox.

BTW, for comparison, you should use Like with wildcards. Otherwise, it will
behave like = only.
 
Back
Top