OK my first post so please be patient with me, and thanks in advance for any and all help!
I have an Access 2007 database where I want the user to be able to type a few charactors into a field and then compare (search) several other fields to return all records that contain those typed-in charactors from those several other fields. Currently, I use this VBA code to compare the input field with the same field in the database, BUT, I want to compare the Me.Title field to 4 other fields as well, but I keep screwing up the Syntax and can't get it right.
' If Title
If Nz(Me.Title) <> "" Then
' Add it to the predicate - match on leading characters
strWhere = strWhere & " AND " & "Issues.Title Like '*" & Me.Title & "*'"
End If
How would I do this? Using IF OR statements with OR on the next line, or a string of AND statements? I think I need to use OR because my understanding of the string of AND statements means it will return the first field found matching and stop searching, when I need to acturally search and return ALL records that match ANY of the searched fields.
So, I need to compare Me.Title to Me.Title, Me.Person(s) Present / Title, Me.Outcome / Result, Me.Actions / Follow Up, Me.Red Flag(s).
I know you pros have probably answered this a million times, but I cannot seem to find the answer.
I have an Access 2007 database where I want the user to be able to type a few charactors into a field and then compare (search) several other fields to return all records that contain those typed-in charactors from those several other fields. Currently, I use this VBA code to compare the input field with the same field in the database, BUT, I want to compare the Me.Title field to 4 other fields as well, but I keep screwing up the Syntax and can't get it right.
' If Title
If Nz(Me.Title) <> "" Then
' Add it to the predicate - match on leading characters
strWhere = strWhere & " AND " & "Issues.Title Like '*" & Me.Title & "*'"
End If
How would I do this? Using IF OR statements with OR on the next line, or a string of AND statements? I think I need to use OR because my understanding of the string of AND statements means it will return the first field found matching and stop searching, when I need to acturally search and return ALL records that match ANY of the searched fields.
So, I need to compare Me.Title to Me.Title, Me.Person(s) Present / Title, Me.Outcome / Result, Me.Actions / Follow Up, Me.Red Flag(s).
I know you pros have probably answered this a million times, but I cannot seem to find the answer.