Suntax for find on a string

livvie

Registered User.
Local time
Today, 23:18
Joined
May 7, 2004
Messages
158
Where should I be putting ' s to make this right. It's fine for a number but not a string


rstEst.Find "partname=" & MyPartName
 
Try...

Code:
rstEst.Find "PartName = " & "'" & MyPartName & "'"
Those are single quotes surrounded by double quotes.
 
Forget ' - it's not the most robust.

rstEst.Find "PartName = """ & MyPartName & """"


For each ' replace with ""
 
I am getting an arguments are of the wrong type, are out of an acceptab;e range or are in conflict with one another. I though it was because of the string but obviously not. What causes this error.
 
livvie said:
I am getting an arguments are of the wrong type, are out of an acceptab;e range or are in conflict with one another. I though it was because of the string but obviously not. What causes this error.
Seems to work ok with the single quotes
 
Mile-O-Phile said:
Forget ' - it's not the most robust.

rstEst.Find "PartName = """ & MyPartName & """"


For each ' replace with ""
Access 97 sometimes errors if I do not use the "'" to enclose a text string in VBA.
 

Users who are viewing this thread

Back
Top Bottom