A family of Microsoft relational database management systems designed for ease of use.
I'd suggest changing your combo box to a multi-select list. Set its MultiSelect property to 'Simple'. You'll then be able to select any of the options singly or in combination:
Add a 'Confirm' button to the form to restrict the results to the selected option(s) and in its Click event procedure put code like this, where lstOptions is the name of the list box:
Dim varItem As Variant
Dim strOptionList As String
Dim strCriteria As String
Dim ctrl As Control
Set ctrl = Me.lstOptions
If ctrl.ItemsSelected.Count > 0 Then
For Each varItem In ctrl.ItemsSelected
strOptionList = strOptionList & ",""" & ctrl.ItemData(varItem) & """"
Next varItem
' remove leading comma
strOptionList = Mid(strOptionList, 2)
strCriteria = "Complete In(" & strOptionList & ")"
' restrict form to selected options
Me.RecordSource = "SELECT * FROM Projects" & _
" WHERE " & strCriteria & _
" ORDER BY ProjectNum DESC"
Else
' show all records if no options selected
Me.RecordSource = "SELECT * FROM Projects" & _
" ORDER BY ProjectNum DESC"
End If
BTW are you using a value list as the combo box's RowSource? If so that's not a good idea as you are hard coding data. You should have a single column Options table with each option as value in a row and use the table to fill the combo (or list) box's list.
Ken Sheridan, Stafford, England