PDA

Click to See Complete Forum and Search --> : Why can't I there be a # in the data?


Carroll
Jan 12th, 2000, 05:53 AM
When the record I want to return contains a # in the criteria the recordset returns no records
for instance cFind = "Jones Store #1" or
cAddr = "6151 Freeport Blvd. #180"

SQL$ = "select [Company], [Address1], [Address2], [City State Zip] from [ShipTo] where [Company] like '" & cFind & "' and Address1 like '" & cAddr & "'"
Data3.RecordSource = SQL$

Any ideas on how to get it to recognize and return the records will be much appreciated.
Thanks!

MartinLiss
Jan 12th, 2000, 08:00 AM
Have you tried this?

SQL$ = "select [Company], [Address1], [Address2], [City State Zip] from [ShipTo] where [Company] like '[" & cFind & "]' and Address1 like '[" & cAddr & "]'"

------------------
Marty

Lil Dave
Jan 13th, 2000, 05:31 PM
I may have missed what you were getting at, but I think the # is a 'key' symbol in Access SQL. It is usually enclosed around dates and therefore may not be able to be used in the way you are attempting

Cheers Dave
aka Lil Dave