Combo Filter

raychuck

New member
Local time
Today, 14:45
Joined
Apr 9, 2002
Messages
8
Having 2 unbound combo boxs on a form, I want the query on the 2nd combo box to reflect what was choosen on the first combo box. For instance if I have a table where there is a group type and group name, when I use the 2nd combo box, I only want the group names for the group type that was selected in the first combo box. I have tried setting the criteria for the 2nd combo query to say something like this: [forms]![formName]!
[Combo1] where Combo1 selects the group type.
Any help you can give me will be very much appreciated :-)
 
Set your second combo box's Row source to:

SELECT "field1, field2, etc." FROM "yourtable" WHERE "ID of record in yourtable" = forms!frmYourForm!combobox1 ORDER BY "whatever sort order you want";



[This message has been edited by Elana (edited 04-09-2002).]
 
Thanks Elana. I had the same problem and this solved it.
 
Thanx for your reply. Ummmm . . . it works but now I have a different problem. After I use the second combo box which queries correctly now based on the first combo box, when I tab back to the first combo box and change the value there, the 2nd combo box still reflects the query based on the previous value in the first combo box. Do I have to do some type of re-query action?
Thanx for your patience :-)
 
On the AfterUpdate event of the 1st combo do Me.[2ndcomboname].requery
 

Users who are viewing this thread

Back
Top Bottom