MS Access 2000: Filtering via combo boxes?

Uconn411

Member
Jul 15, 2000
152
0
0
I have been looking all over google and its newgroups on how to do this. I haven't yet found a full proof way. I am looking to take a combo box "Category" that has fields such as computer, monitor, printer, etc..., and once a user makes a selection, the combo box below it called "Model" will display the correct info. For example, if a user selects "Monitor" from the "Category" combo box, the combo box "Model" should only display monitors, not pc or printers. Thanks for any help.
 

SQL

Member
Jul 10, 2001
115
0
0
Basically you want to set the rowsource property of the 2nd combo box during the afterupdate event of the 1st combo box.

Now what you set the rowsource to is up to you, you could set it to seperate queries you created or you could roll your own select statement.


If you want to dynamically create the row source, you could do the following in an afterupdate event:

combo2.rowsource="select model from partstable where category='" & combo1 & "';"
combo2.requery ' Makes the combobox refresh the data based on the new rowsource

This is just an example, I have no idea how your tables are laid out. Hopefully this gives you something to run with.



 

Uconn411

Member
Jul 15, 2000
152
0
0
I was also considering check boxes for filtering. So, I could setup checkboxes for "Computer", "Monitor", "Printer" etc... and filter the results for the combo box below this, based on what the user selects. I think this is possible....