Combo Boxes in Access Form

stuckincement

New Member
Joined
May 5, 2014
Messages
26
Hi,

I have two combo boxes that I created that allow a user to filter data down to a specific record (First, facility, then department number). Department numbers can repeat by facility however I did set the row source to be based on the facility that was picked in the first combo box. This works fine for the first user selection but the next selection it does not follow the same logic and thus picks a random facility/department combo instead of the one picked by the user in the combo box.

How can I allow a user to make a second selection of facility, then department and it work as it did for their first selection?

Thanks,
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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 Company (in that state)
The 1st combo,(say cboStates)... User picks a state, then picks a company from the cboCo box.
The cboStates AfterUpdate event will trigger when the user picks it, and this will update the next combo.

sub cboStates_AfterEvent()
cboCo.requery
end sub

The cboCo query (say qsCoViaState) will reference the cboStates in the query sql
Select * from tCompany where [ST] ='" & forms!frmMain!cboStates & "'"
The CO combo must be refreshed (cboCo.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 cboCo.
Code:
sub cboCo_AfterEvent()
 cboEmps.requery
end sub
 
Upvote 0

Forum statistics

Threads
1,214,377
Messages
6,119,182
Members
448,872
Latest member
lcaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top