Access MVP (2010-2015)

oOo.oOo.oOo.oOo.oOo.oOo

Quotes within Quotes (Apostrophes also)

You want to use TEXT as the Control Source of a Control on your Form but you keep getting an error OR it doesn’t show as expected because your text contains an apostrophe or quotation mark(s). For help see chart below…

Control Source Property Result Explanation
=”This is literal text.” This is literal text. Literal text goes in quotes.
=”Here is a “word” in quotes” Access thinks the quote finishes before word, and does not know what to do with the remaining characters.
=”Here is a “”word”” in quotes” Here is a “word” in quotes You must double-up the quote character inside quotes.
=”Here is a “”word””” Here is a “word” The doubled-up quotes after word plus the closing quote gives you 3 in a row.

When quotes or apostrophes appear in TEXT use:

"field =""" & Me.field & """"

Loading

Comments are closed.