|
-
Sep 11th, 2000, 11:06 AM
#1
Thread Starter
Member
I am trying to filter a recordset.
ie rstSetName.Filter = "KEYFIELD = '" & varName & "'"
My problem: if there is a ' or a " in varName it ends the string for my filter and messes it up. I have been told to do something like this.
rstSetName.Filter = "KEYFIELD = '" & replace(varName, "'", "''" & "'")
This does stop the filter from crashing, however it doesn't really solve my problem because the filter is incorrect, and doesn't find the data I want it to. I have been scratching my head over this one for a while, so any help would be super cool!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|