N
NKK
I have a form with a combobox (combo1) and a listbox (list1); the controls
are unbound and the row sources are two different tables with a common field
(system_id). I would like to use the value chosen in combo1 in a subquery to
make up the "where" clause of list1, but I am not sure quite how to
accomplish this or which event to use. Ideally, I want the row source of
list1 to be:
"select list_table.field1, list_table.field 2 from list_table where
list_table.system_id=(select combo_table.system_id from combo_table where
combo_table.field2=combo1).
I started out with a sub-form with a parameterized query and when I manually
entered a value, it worked correctly, however I could not figure out how to
pass the value from the combo as a parameter. Now I have both the controls
on the same form, hoping I could filter it somehow, but that does not seem to
be feasible. A point in the right direction would be greatly appreciated!
are unbound and the row sources are two different tables with a common field
(system_id). I would like to use the value chosen in combo1 in a subquery to
make up the "where" clause of list1, but I am not sure quite how to
accomplish this or which event to use. Ideally, I want the row source of
list1 to be:
"select list_table.field1, list_table.field 2 from list_table where
list_table.system_id=(select combo_table.system_id from combo_table where
combo_table.field2=combo1).
I started out with a sub-form with a parameterized query and when I manually
entered a value, it worked correctly, however I could not figure out how to
pass the value from the combo as a parameter. Now I have both the controls
on the same form, hoping I could filter it somehow, but that does not seem to
be feasible. A point in the right direction would be greatly appreciated!