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

Declaring Double Quotes in a String Value

Status
Not open for further replies.

Bob1912

Technical User
Dec 16, 2002
2
US
I need to use the below string in an Access 2002 function so my code will perform an auto-replacement loop. The problem is the string : (“Program” NOT Available) : will not compile because of the double quotes. I have tried []'s, strquote = Chr$(34), extra double quotes, wildcards and I cannot seem to get anything to work. I would appreciate any assistance or pointing me in the right direction. Thanks.
 
Not sure what you are trying to do. If you want a message box to display: "Program" not available where the double quotes are displayed as part of the message, then it should look like this:

msgbox """program"" not available"
 
Usually a double quote (") signals the beginning or end of a string or SQL statement. If you want to reference a literal inside the double quotes try using an apostrophe (') around the literal, e.g.

DoCmd.RunSQL "SELECT * FROM table WHERE table.key = 'fish'"

AvGuy
 
try "(" & chr(34)& "Program" & chr(34)& " NOT Available) :"
 
Thanks for all the responses, pwise was the one I needed. I could have sworn I had tried that one before. Thanks again for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top