line feed in a string variable

L

Laurel

1 - How do you insert a "line feed" ("new line", "carriage
return") into a string variable, e.g., for display in the
MsgBox function?

2 - Where in HELP can you find information about special
characters such as this and tab, etc.?
 
R

Randy Harris

Laurel said:
1 - How do you insert a "line feed" ("new line", "carriage
return") into a string variable, e.g., for display in the
MsgBox function?

2 - Where in HELP can you find information about special
characters such as this and tab, etc.?

One method of doing so (probably the most commonly used), is to use the
Access constant vbCRLF.

MsgBox "First Line of Text" & vbCRLF & "Second Line of Text"

Regrettably, the Help is not one of Access's better features.
 
K

Kevin

2 - Where in HELP can you find information about special
characters such as this and tab, etc.?

I agree with Randy, using a pre-defined Visual Basic is
easier on the memory and produces more readable code. For
a list of pre-defined constants, search the Visual Basic
Help under "Visual Basic Constants".

(Click <Ctrl>-G from the Access window to open the VB
Window b4 invoking Help)

HTH
Kevin Sprinkel
Becker & Frondorf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top