Microsoft KB Archive/209791

= ACC2000: How to Force a New Line in a MsgBox Message =

Article ID: 209791

Article Last Modified on 7/15/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q209791



Novice: Requires knowledge of the user interface on single-user computers.

For a Microsoft Access 2002 version of this article, see 281670.



SUMMARY
If you want to force a new line in a message box, you can include either:
 * The Visual Basic for Applications Constant for a carriage return and line feed, vbCrLf.

-or-
 * The character codes for a carriage return and line feed, Chr(13) & Chr(10).

For example, if you had the message

NOTICE: This is an Important Message!

and, you wanted the message to be displayed as

NOTICE:

This is an Important Message!

you would enter the message as a string expression as in either of the following examples.   Example Using the Visual Basic for Applications Constant: MsgBox "NOTICE:" & vbCrLf & "This is an Important Message!"   Example Using the Character Codes: MsgBox "NOTICE:" & Chr(13) & Chr(10) & "This is an Important Message!" 

You can also use this technique to provide multiple lines in a text box on a form.

