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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access query using the 'LIKE' statement 1

Status
Not open for further replies.

scottian

Programmer
Jul 3, 2003
955
GB
Ive trawled through here looking for a solution but i cant find exactly what i need. Im trying to put togehter a query that uses the 'Like' statement, but i cant seem to work it out. This is what im trying to use:-

WHERE (((tblPRData.PRNumber) Like [Forms]![frmMyWork]![frmMyWorkPRList].[Form]![Text14] & "*"));

But i keep getting syntax error-missing operator.

I want the query to check a text box on a form and use the contents of the text box as the the begining part of the criteria.

"Children are smarter than any of us. Know how I know that? I don't know one child with a full time job and children."...Bill Hicks
 
Did you try putting single quotes around the variable?

WHERE (((tblPRData.PRNumber) Like [red]"'" [/red]& [Forms]![frmMyWork]![frmMyWorkPRList].[Form]![Text14] & "*[red]'[/red]" ));
 
What about this, if the above doesn't work:

Code:
WHERE tblPRData.PRNnumber LIKE "'" & [Forms]![frmMyWork]![Text14] & "*'"


~Melagan
______
"It's never too late to become what you might have been.
 
sxschech, spot on...works great now.

"Children are smarter than any of us. Know how I know that? I don't know one child with a full time job and children."...Bill Hicks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top