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

Syntax to Include Apostrophe?

Status
Not open for further replies.

jt463

IS-IT--Management
Nov 23, 2005
134
What is the proper syntax for the criteria to include a name with an apostrophe?

Name: Swanson's Farm

Criteria:
Code:
Subdivision = ''Swanson's Farm''

That code keeps blowing up on me. I have tried ""Swanson's Farm"" and a number of combinations of apostrophes and quotes but can't seem to figure out the correct combination.

Thanks in advance.
 
I figured it out:

Code:
Subdivision = ""Swanson's Farm""
 
My way:[tt]
someValue = "Swanson's Farm"
criteria = "Subdivision = '" & Replace(someValue, "'", "''") & "'"[/tt]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top