Thread: Filtered Drop down lists
05-03-09, 20:27 #1Registered User
- Join Date
- May 2009
Unanswered: Filtered Drop down lists
Its been years since i've touched Access, so this may be a simple question. Nevertheless my manager is attempting to create a form where when the client chooses a certain option in the first drop down list, this will mean only certain selections are available in the next drop down list.
If security is selected list 2 would have options a, b, c etc
If building maintenance is selected then options d,e,f would be displayed in the 2nd drop down list.
Im not sure if this requires a relationship, in all honesty I wouldn't know where to start, as its been years.
(Using Access - Office XP)
05-03-09, 21:16 #2Moderator
- Join Date
- Dec 2004
- Madison, WI
If the 2nd list box values are not many, you can always set the rowsource of the listbox depending on what value is selected in the 1st listing (ie. in the Afterupdate event of the 1st listbox). For this, you'd set the 2nd listbox/combobox rowsource query type property to: Value List.
If using a query for the 2nd listing, in the rowsource of your 2nd combobox/listbox, you'll need a field to "match" values in the first listing and use that in the criteria of the query for the rowsource (ie. =Forms!MyListingFormName!My1stListboxName)
Then you just issue a me.my2ndListboxName.requery command in the AfterUpdate event of the 1st listbox/combobox.
Just make sure the 1st listing is returning the value you need to match the criteria you're using for the 2nd listbox/combobox.Expert Database Programming
MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)