Hello all! This is my first post but I have used a great deal of information from this site for some of my projects. I have scoured the internet looking for a solution to my problem but thus far I have yet to find an answer- I'm hoping some of you might be able to assist.
I have a DoCmd.ApplyFilter that checks the value of a checkbox. If the checkbox value is true then bring back all records that are active AND any records that are like the string entered into the SrchTxt text box in the specified fields. When I run the search and the checkbox = true, I get a type mismatch error. As soon as checkbox value=false, it runs smooth which lends me to believe that my problem lies in the first line after my Then statement.
Any help with this would be incredibly appreciated!!
Code:
On Error GoTo SrchByID_Err
If Me.Check237.Value = True Then
DoCmd.ApplyFilter "SrchByID", "[StatusCurrent] = ""Active""" _
& [Item] Like "" * "" & [Forms]![ItemFinder]![SrchTxt] & "" * "" _
Or [SS_Item] Like "" * "" & [Forms]![ItemFinder]![SrchTxt] & "" * "" _
Or [Mfg Itm ID] Like "" * "" & [Forms]![ItemFinder]![SrchTxt] & "" * "" _
Or [SupplierItemID] Like "" * "" & [Forms]![ItemFinder]![SrchTxt] & "" * "" _
Or [SS_description] Like "" * "" & [Forms]![ItemFinder]![SrchTxt] & "" * "" _
Or [PSDescription] Like "" * "" & [Forms]![ItemFinder]![SrchTxt] & "" * """, """
Else
DoCmd.ApplyFilter "SrchByID", "[Item] Like ""*"" & [Forms]![ItemFinder]![SrchTxt] & ""*""" _
Or [SS_Item] Like "" * "" & [Forms]![ItemFinder]![SrchTxt] & "" * "" _
Or [Mfg Itm ID] Like "" * "" & [Forms]![ItemFinder]![SrchTxt] & "" * "" _
Or [SupplierItemID] Like "" * "" & [Forms]![ItemFinder]![SrchTxt] & "" * "" _
Or [SS_description] Like "" * "" & [Forms]![ItemFinder]![SrchTxt] & "" * "" _
Or [PSDescription] Like "" * "" & [Forms]![ItemFinder]![SrchTxt] & "" * """, """
SrchByID_Exit:
Exit Sub
SrchByID_Err:
MsgBox Error$
Resume SrchByID_Exit
End If
End Sub