L
Lauren B
I have built a search page into my database that allows user to search
entries based on a variety of criteria (Customer name, address, city, state,
etc.) I have used the following format:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "USER_SEARCH_FORM"
stLinkCriteria = ""
If Len(Trim(Me.USER_ID)) > 0 Then
stLinkCriteria = stLinkCriteria & "[USER_ID] Like '*" & Me.USER_ID & "*' AND
"
End If
If Len(Trim(stLinkCriteria)) > 0 Then
stLinkCriteria = Left(stLinkCriteria, Len(stLinkCriteria) - 5)
End If
If DCount("*", "USERS_TABLE", stLinkCriteria) = 0 Then
MsgBox "No records found."
Else
DoCmd.OpenForm "USERS_FORM", , , stLinkCriteria
stDocName = "USER_SEARCH_FORM"
stLinkCriteria = ""
End If
End Sub
When I use this search, it works fine; however, results only return if the
user uses the correct capitalization (ie. if a user is searching in the
state field and they put "PA" they will get all customers in PA but, if the
user puts "pa", they will get no results. Is there a way to add to the
coding above to have capitalization disregarded?
Thank you in advance for any assistance.
LB
entries based on a variety of criteria (Customer name, address, city, state,
etc.) I have used the following format:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "USER_SEARCH_FORM"
stLinkCriteria = ""
If Len(Trim(Me.USER_ID)) > 0 Then
stLinkCriteria = stLinkCriteria & "[USER_ID] Like '*" & Me.USER_ID & "*' AND
"
End If
If Len(Trim(stLinkCriteria)) > 0 Then
stLinkCriteria = Left(stLinkCriteria, Len(stLinkCriteria) - 5)
End If
If DCount("*", "USERS_TABLE", stLinkCriteria) = 0 Then
MsgBox "No records found."
Else
DoCmd.OpenForm "USERS_FORM", , , stLinkCriteria
stDocName = "USER_SEARCH_FORM"
stLinkCriteria = ""
End If
End Sub
When I use this search, it works fine; however, results only return if the
user uses the correct capitalization (ie. if a user is searching in the
state field and they put "PA" they will get all customers in PA but, if the
user puts "pa", they will get no results. Is there a way to add to the
coding above to have capitalization disregarded?
Thank you in advance for any assistance.
LB