dhookom, thanks, the code worked and displayed the filtered records correctly. I added a copied version of your code modified so that I it would remove the filter upon seeing a blank zip code, and that worked!
However, after initially opening the form, but before clicking on the zipcode filter, the list box would normally allow me to click on a record in the list and the form would go to that record and other text boxes in the form connected to fields in that record would display the selected record info correctly.
However, after activating the zip code filter with the command button and the new code, the list box correctly shows the filtered zipcode records but appears to be disconnected from the the form, i.e., if a filtered record is clicked in the list box, the form text boxes do not change to show the new record info.
This is your slightly modified code as I am now using it:
Dim strSQL As String
If Not IsNull(Me.Text22) Then
strSQL = "SELECT ClientID, ClientName,ZipCode FROM tblClients " & _
"WHERE ZipCode ='" & Me.Text22 & "'" & _
" ORDER BY ClientName"
Me.List20.RowSource = strSQL
End If
'New part to clear the zipcode filter
If IsNull(Me.Text22) Then
strSQL = "SELECT ClientID, ClientName,ZipCode FROM tblClients " & _
" ORDER BY ZipCode "
Me.List20.RowSource = strSQL
End If
Also, I need the "ORDER BY ZipCode" above to be "Descending", but I couldn't figure out how to add it in. I tried several combinations but to no avail. I am sure it is very simple.
Again, Thanks,