Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asterix operators in like statement in VBA

Status
Not open for further replies.

Warrior

Programmer
Apr 14, 2000
9
NL
hello every one this is the query i use in VBA with a&nbsp;&nbsp;querydef definition<br><br>Dim dbs As Database<br>Dim qdfTest As QueryDef<br>Dim strSQL As String<br>Set dbs = CurrentDb()<br><br>strSQL = &quot;SELECT Stoffen.STOFNAAM, Stoffen.SYNONIEM_1, Stoffen.SYNONIEM_2, Stoffen.SYNONIEM_3, &quot; & _<br>&quot;Stoffen.FORMULE, Stoffen.CAS_NUM, Stoffen.GEVAAR_SYM, Stoffen.MOL_GEW, Invoer.RUIMTE, &quot; & _<br>&quot;Invoer.HOEVEELH, Invoer.EENHEID, Invoer.Plaatscode, Invoer.UGD, Invoer.datum, &quot; & _<br>&quot;Invoer.leveranc , Invoer.zuiverh, Invoer.certnr, Invoer.lotnr, Invoer.memo &quot; & _<br>&quot;FROM Invoer RIGHT JOIN Stoffen ON Invoer.STOF_REF = Stoffen.STOF_REF &quot; & _<br>&quot;ORDER BY Stoffen.STOFNAAM&quot;<br><br>dbs.QueryDefs.Delete &quot;query2&quot;<br>Set qdfTest = CurrentDb.CreateQueryDef(&quot;query2&quot;, strSQL)<br>DoCmd.OpenQuery &quot;query2&quot;, , acPreview<br><br><br>My question is in wich part and wich way i need to ajust the code to let the user give an item to search for what needs to be in the record it is always tekst but it don't need the be exactly that word.<br><br>sincerly warrior
 
Not sure what is the &quot;ASK&quot; word above<br>but this is an example<br><br>Dim Myvalue as variant<br>SQL = &quot;Select * From YourTable Where Yourfield Like '&quot; & Myvalue & &quot;*'&quot;<br><br>Notice the Asterisk after the (Myvalue & &quot;*) <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top