So I have a continuous form with a filter at the top. At the bottom, there's a blank record that I would like to not see. My code is:
Private Sub cmdFilter_Click()
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.AgencyCode) Then
strWhere = strWhere & "([AgencyCode] = " & Me.AgencyCode.Value & ") AND "
End If
If Not IsNull(Me.AgencyName) Then
strWhere = strWhere & "([AgencyName] Like ""*" & Me.AgencyName & "*"") AND "
End If
If Not IsNull(Me.LicensingRep) Then
strWhere = strWhere & "([LicensingRep] = """ & Me.LicensingRep & """) AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "No criteria", vbInformation, "Nothing to do."
Else
strWhere = Left$(strWhere, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub