The specifics here depend on your field name and the data type of that
field.
This example shows how to filter a Text type field named City, based on the
user's choice in an unbound combo named cboFilterCity:
Private Sub cboFilterCity_AfterUpdate()
Dim strWhere As String
If Not IsNull(Me.cboFilterCity) Then
strWhere = "[City] = """ & Me.cboFilterCity & """"
'Debug.Print strWhere
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub
If the field is a Number type, drop the extra quotes:
strWhere = "[City] = " & Me.cboFilterCity
If the string is not working as expected, remove the apostrophy from the
beginning of the Debug.Print line. Then when it fails, open the Immediate
Window (Ctrl+G), and see what came out. It needs to look just like the WHERE
clause in a query.
It is possible to build a more involved search form, with lots of unbound
search boxes at the top, and build the filter from just those boxes where
the user entered some criteria. If you are interested in that, you can
download a little sample here:
http://allenbrowne.com/unlinked/Search2000.zip