=========
QUESTION
———
I need to have double quotes (“) in a string in VBA, as I am entering WHERE statements in a SQL statement, but every time I have quotes in a string, it errors out.
=========
ANSWER
———
Any time you have double quotes (“), simply double them (“”) and you will be fine.
=========
EXAMPLES
———
Dim SQLTxt As String
SQLTxt = “SELECT table.field, table.field2, table.field3” & _
“FROM table” & _
“WHERE table.field=””O””) AND table.field=””C””;”
=========
APPLIES TO / KEY WORDS
———
Microsoft Access
VBA
String
Quotes
Double Quotes
Curly Quotes
=========
REF
———
http://www.everythingaccess.com/tutorials.asp?ID=Quotation-marks-within-quotes
—
http://www.anysitesupport.com/access-vba-how-to-put-double-quotes-in-a-string/
http://anySiteHosting.com