UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Wilcard syntax - VBA SQL for rowsource    
 
   
MattJ
post Sep 5 2006, 09:29 AM
Post #1

UtterAccess VIP
Posts: 4,621
From: North Carolina, USA



I'm attempting to set a row source of a list box. The only field which has any critera has a text datatype, for which I would like to use a variable with a wildcard (*).
So far, if I only use the variable as the criteria, the statement performs as intended. If I try to include the asterisk, I get nothing. and darned if I can figure out the syntax.

CODE
"SELECT tblMessage.MsgPK, tblMessage.Date_Stamp, tblMessage.Msg " & _
                            "FROM tblMessage " & _
                            "Where (((tblMessage.Msg) =[color="red"] '" & strSitePrefix & "'[/color]))" & _
                            "ORDER BY tblMessage.Date_Stamp DESC;"


strSitePrefix is a 3 character text string (example ABC), and I would like the criteria to ultimately be "*ABC*"

Thanks,
Matt
Go to the top of the page
 
+
dashiellx2000
post Sep 5 2006, 09:36 AM
Post #2

UtterAccess VIP
Posts: 9,209
From: Maryland



Try:

CODE
Where (((tblMessage.Msg) = '*" & strSitePrefix & "*'))" & _


HTH.
Go to the top of the page
 
+
MattJ
post Sep 5 2006, 09:47 AM
Post #3

UtterAccess VIP
Posts: 4,621
From: North Carolina, USA



So simple... (IMG:http://www.utteraccess.com/forum/style_emoticons/default/crazy.gif)
Thanks William
Go to the top of the page
 
+
dashiellx2000
post Sep 5 2006, 11:21 AM
Post #4

UtterAccess VIP
Posts: 9,209
From: Maryland



Glad I could help. Good luck with your project.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th May 2013 - 09:53 PM