View Full Version : Escape Quotations


kwatai
07-23-2001, 01:48 PM
The subject says it all, how do I escape quotes in a quote. For example
msgbox "You entered "" & Name & "" as your input"
and it should come out
You entered "Jon" as your input

Its so easy in C but can't figure it out in VB. Also, how do you specify a new line?

thx
Kenta

Axis
07-23-2001, 02:39 PM
Use the Chr() function to insert quotes, with the ascii number for the quote character.
"You entered " & Chr(34) & Name & Chr(34) & "as your input."

For a new line, Access wants a carriage return AND a line feed to create line breaks. Try
[First Field] & Chr(13) & Chr(10) & [Second Field] etc.