Hello all,
I am having trouble making my search box work with all the fields. The PPNumYr field was originally a string and the numbers had leading zeros such 0197, 0297 and then I changed it to Numbers so the leading zero is now gone but there are numbers with zeros in the middle. I have posted my code below and I realize since I changed the field to numbers InStr does not work anymore but it did not work when the numbers were still a string. How can I fix this? Another field that I want to be searched is names of locations and I am not sure how to do that either, which is the second part of the code. Please help
If InStr(SearchText, "###") <> 0 Then
DoCmd.OpenForm "PhotopointF", , , "PPNumYr=""" & SearchText & """"
Exit Sub
End If
If InStr(SearchText, "Out House", "East caves", "Bottom Hill") <> 0 Then
DoCmd.OpenForm "PhotopointF", , , "LocationName=""" & SearchText & """"
Exit Sub
End If