|
-
Oct 20th, 2005, 11:40 PM
#1
Thread Starter
Lively Member
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
-
Oct 20th, 2005, 11:43 PM
#2
Re: WHERE x LIKE [% " & me.text & " %] vba and sql syntax issue
What error was raised? Have you tried * instead?
-
Oct 20th, 2005, 11:46 PM
#3
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 & "%'"
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 21st, 2005, 12:46 AM
#4
Thread Starter
Lively Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|