apostrophe in string index's

wjburke2

Registered User.
Local time
Today, 04:10
Joined
Jul 28, 2008
Messages
194
I have a screen that has three fields Category, Campaign, CamType these three fields are a unique index for a table. I query the table to ensure the user entered a unique value before I try to update the table. I get this error.

strFilter = "CatId = '" & Me!txtCategory & _
"' AND Campaign = '" & Me!txtCampaign & _
"' AND CamType = '" & Me!txtCamType & "'"
strCam = DLookup("Campaign", "Campaign", strFilter

Syntax error (missing opertor) in query expresion 'CatId = 'CAT-1' AND Campaign = 'ADB' AND CamType = 'Jim's"

Is there a way to strip out the apostrophe, or is there a better way that will allow them to keep the apostrope?
 
Thanks for your input dkinley. I found the answer on another forum. It was an easy fix.

Me.txtCamType = Replace(Me.txtCamType, "'", "")
 
You bet. Thanks for posting the final resolution back.

-dK
 

Users who are viewing this thread

Back
Top Bottom