Originally Posted by
June7
Now you need a control for input of parameter. As explained in other thread, I use a combobox. When user selects field in first combobox, code changes the RowSource of second combobox to offer list of values from the selected field. After user selects value from second combobox, code constructs filter string. If all fields are text type, the code is simple:
Me.Filter = Me.firstcomboboxname & "='" & Me.secondcomboxname & "'"
Me.FilterOn = True
However, some of your fields are date type. Date fields require # delimiters (note the apostrophe delimiters in the example). Number type would not have any delimiters. This means you will need conditional code, like:
IIf Me.firstcombobox LIKE "Date*" Then
Me.Filter = Me.firstcomboboxname & "=#" & Me.secondcomboxname & "#"
Else
Me.Filter = Me.firstcomboboxname & "='" & Me.secondcomboxname & "'"
End If