How do i filter a form with multiple combo boxes? (Access 2010 Web database)

TE160772

New member
Local time
Today, 00:47
Joined
Aug 25, 2015
Messages
2
Hi All,
I'm not that good with database forms. I have built a database though and put a form on it to view the data. I would like to have multiple drop-down lists (combo boxes) to filter the data down to as little rows as possible.

I need to use 2 combo-boxes namely Region and Supervisors. I have successfully created and using set filter action to achieve the result i am looking for. However i am not able to use 2 combo boxes at the same time. What it means is when i choose something from Region combo box other combo box would be unfiltered and vice versa. I don't want o happen like this. What i am trying to do here is once region Combo box is selected then i should be able to choose the respective supervisor from Supervisor combo box.

From selecting the first combo box, i would like that filtered data to be filtered even further by another combo box or 2. Is this possible and how would i go about implementing it?
Thanks
 
To do the multi-combo box
each combo box has a query for its recordsource.
Here the user picks a state, then in the next combo picks a City (in that state)

The 1st combo,(say cboStates)... User picks a state, then picks a city from the cboCity box.
The cboStates AfterUpdate event will trigger when the user picks it, and this will update the next combo.


Code:
sub cboStates_AfterUpdate()
 cboCity.requery
end sub


The cboCity query (say qsCityViaState) will reference the cboStates in the query sql
Select [city] from tZipCodes where [ST] ='" & forms!frmMain!cboStates & "'"

if cboState is empty then there will be nothing in the cboCity box
The City combo must be refreshed (cboCity.requery action) after user picks the state so it can deliver the resulting dataset.

If there is another combo after this say cboEmps to pick employees, then the cboEmp must be refreshed after user picks cboCity.
Code:
sub cboCity_AfterUpdate()
 cboEmps.requery
end sub
 
Thank you for your reply however i can not use VBA code since it is a web database. We should achieve it through macro itself.
 

Users who are viewing this thread

Back
Top Bottom