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
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%") ?