I am trying to create a form with two combo boxes. I would like to select a category in the first box and then have the second box display only the items in that category. Do I need the information to come from one query? Please give an example.
Private Sub Combo1_AfterUpdate()
Combo2.Rowsource = "SELECT LNAME FROM MYTABLE WHERE SEX = '" & Combo1 & "'"
End Sub
In the above example...
Combo1 has sex M and F.
Which ever sex you choose will show in Combo1.
Combo2 now has all the last names of each person from our table that for this sex.
ljprodev@yahoo.com
ProDev, MS Access Applications B-)
thanks for your help. I'm having some trouble getting it to work. I have put the code from your example into the event for AfterUpdate of the 1st combo box. But, I get an error message about the select statement when I click on the 2nd box. This is what mine looks like, please let me know whats wrong.
Private Sub Combo1_AfterUpdate()
Combo2.RowSource = "Select [LastName] = '" & Combo1 & "'"
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.