F
Fred Boer
Hello:
I use data entered in a textbox to generate a SQL statement. I am aware that
Access trims the trailing spaces from the data in the textbox. Is there some
way to preserve these spaces? For example, suppose I want the search to find
instances of "Bob" but not "Bobby", and I enter "Bob " into the textbox
(note the trailing space...).
Thanks!
Fred Boer
Here is some of the code this would work with (fncQuoted deals with embedded
quotes)...
If Len(Me.txtKeyword) > 0 Then
sWHERE = " OR Author Like " & fncQuoted("*" & txtKeyword & "*") & _
" OR Title Like " & fncQuoted("*" & txtKeyword & "*") & " OR Subject
Like " _
& fncQuoted("*" & txtKeyword & "*") & " Or Series Like " &
fncQuoted("*" & _
txtKeyword & "*") & " Or ISBN Like " & fncQuoted("*" & _
txtKeyword & "*")
End If
I use data entered in a textbox to generate a SQL statement. I am aware that
Access trims the trailing spaces from the data in the textbox. Is there some
way to preserve these spaces? For example, suppose I want the search to find
instances of "Bob" but not "Bobby", and I enter "Bob " into the textbox
(note the trailing space...).
Thanks!
Fred Boer
Here is some of the code this would work with (fncQuoted deals with embedded
quotes)...
If Len(Me.txtKeyword) > 0 Then
sWHERE = " OR Author Like " & fncQuoted("*" & txtKeyword & "*") & _
" OR Title Like " & fncQuoted("*" & txtKeyword & "*") & " OR Subject
Like " _
& fncQuoted("*" & txtKeyword & "*") & " Or Series Like " &
fncQuoted("*" & _
txtKeyword & "*") & " Or ISBN Like " & fncQuoted("*" & _
txtKeyword & "*")
End If