WHERE x LIKE [% " & me.text & " %] vba and sql syntax issue
Hello there,
i'm working on a simple search application using sql commands on access 03.
how can i add % % into this line of condition?
WHERE Name LIKE [" & me.text & "].
i'm thinking along the line of LIKE [ % " & me.text & " % ] which gives error.
Any sugguestions?
Thank You
Astro
Re: WHERE x LIKE [% " & me.text & " %] vba and sql syntax issue
What error was raised? Have you tried * instead?
Re: WHERE x LIKE [% " & me.text & " %] vba and sql syntax issue
Whats the error?
Try this assuming that Name is a field in your table and Me.Text is your forms caption that is the criteria for the clause. Also, Name is a Text field in your table.
VB Code:
SELECT * FROM Table1 WHERE [Name] LIKE '%" & Me.Text & "%'"
Re: WHERE x LIKE [% " & me.text & " %] vba and sql syntax issue
hey there,
sorry i changed it to LIKE '%" & Me.Text & "%'
it works fine now =)
Thanks!
Astro