Good morning!
I am trying to filter a form based on a wildcard search, I also need to filter it IF a date filter is in place. Here's what I have and the results it produces.
Code:
Private Sub WildProjectName_AfterUpdate()
Dim strWhere As String
'Make string
If Nz([Forms]![FMainMenu].[DateFilter], "") <> "" Then
strWhere = strWhere & "[biddate] >= #" & [Forms]![FMainMenu]![DateFilter] & "# AND "
End If
If Nz(Me.WildProjectName, "") <> "" Then
strWhere = strWhere & "ProjectName like '*" & [Forms]![FMainMenu]![FProjectMain].[Form]![WildProjectName] & "*'"
End If
'Apply filter
If strWhere <> "" Then
Me.Form.Filter = strWhere
Debug.Print strWhere
Form_FProject.FilterOn = True
'Else
Form_FProject.Filter = ""
Form_FProject.FilterOn = False
End If
End Sub
Debug gives me: [biddate] >= #7/2/2020# AND ProjectName like '*veri*', yet it doesn't filter the form correctly/at all. I thank you in advance for taking the time!