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

Type Mismatch of another kind

Status
Not open for further replies.

mdweezer

Technical User
Jun 15, 2004
56
US
I'm trying to pull in data for a report by using a form, then passing values from that form to the report and using a Me.RecordSource to display the report.

The value passes to the report fine and I can hold my mouse over it and see it's value. The following line screws up and gives me the type mismatch error:
Code:
qry = qry * "WHERE (((TBL_Items.Item)=" & TitleValue & "));"

TBL_Items.Item is a text field and TitleValue contains the string that I would like to compare against the Item field.

What would be the correct way so it would return any record where TBL_Items.Item contains any of the text in TitleValue

Thanks!
 
Sorry folks...

I'm an idiot :) Instead of using concatanating the string with an "&", as you can see I typed a "*" on accident...

Good thing Fridays are only half days where I work!

Yikes...
 
Try it this way:

Code:
qry = qry * "WHERE (((TBL_Items.Item)= '" & TitleValue & "'));"

If the data in TitleValue is a string, you will need to use the single quote around it.

Phil Edwards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top