ChrisLeicester
Member
- Local time
- Today, 07:44
- Joined
- Feb 14, 2025
- Messages
- 63
Hi All
I am trying to do a search button on a continuous form to search for records that contain some of what is entered in the textbox.
When running I get a syntax error saying missing operator.
Printing the strSQL in the imediate window shows;
[TransDesc] = Like '*zilch*'
which to me looks right. I do have the [TransDesc] field on the form
What have I done wrong now
Thanks in advance
Chris
I am trying to do a search button on a continuous form to search for records that contain some of what is entered in the textbox.
Code:
Private Sub SearchBTN_Click()
Dim strSQL As String
strSQL = "[TransDesc] = " & "Like '*" & Me.SearchBox & "*'"
Me.Filter = strSQL
Me.FilterOn = True
End Sub
When running I get a syntax error saying missing operator.
Printing the strSQL in the imediate window shows;
[TransDesc] = Like '*zilch*'
which to me looks right. I do have the [TransDesc] field on the form
What have I done wrong now
Thanks in advance
Chris