Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Tue, 07 Oct 2008 04:21:29 GMT,    group: microsoft.public.access.queries        back       


HELP! How do use LIKE in unbound text box?   
I have the query as follow:
WHERE (((tblAccounts.a_FileType)='Arden') AND ((tblAccounts.a_BillName) Like
"Psych%"))

I have unbound textbox, the value in text box = the value in tblAccounts.
a_BillName

In VBA when I use following code  it work:
 ((tblAccounts.a_BillName) = " & """" & txtbox & """" & ")) "

But it has to be exact name.  How do I use LIKE in the above query (such as
LIKE "Psych%") ?

Thanks in advance for any input.

B.rgds,
Ges

-- 
Ges Khu
Geskhu@yahoo.com
Access Beginner

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200810/1
date: Tue, 07 Oct 2008 04:21:29 GMT   author:   ges u44973@uwe

Re: HELP! How do use LIKE in unbound text box?   
Try:
    strWhere = "[a_BillName] Like """ & Me.txtbox & """%"

Explanation of the quote marks:
    Quotation marks within quotes
at:
    http://allenbrowne.com/casu-17.html

You may need * rather than % as the wildcard.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"ges" <u44973@uwe> wrote in message news:8b463bb52ed58@uwe...
>I have the query as follow:
> WHERE (((tblAccounts.a_FileType)='Arden') AND ((tblAccounts.a_BillName) 
> Like
> "Psych%"))
>
> I have unbound textbox, the value in text box = the value in tblAccounts.
> a_BillName
>
> In VBA when I use following code  it work:
> ((tblAccounts.a_BillName) = " & """" & txtbox & """" & ")) "
>
> But it has to be exact name.  How do I use LIKE in the above query (such 
> as
> LIKE "Psych%") ?
date: Tue, 7 Oct 2008 13:01:11 +0800   author:   Allen Browne lid

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us