Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MsgBox Return Character.

Status
Not open for further replies.

sacheson

Programmer
Mar 30, 2000
55
US
I am creating several message box alerts in an Access,&nbsp;&nbsp;some of them are rather verbose.&nbsp;&nbsp;I am wondering if there is a symbol or character that I can insert to my messages that forces a line break in the middle of the text.<br><br>Example:&nbsp;&nbsp;<font color=red><i>XXXXXXX XXXXX XXXXXX XXXXXX XXXX XXXX</i></font><br>Could be: <font color=red><i>XXXXXXX XXXXX XXXXXX<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XXXXXX XXXX XXXX</i></font><br><br>Thanks,<br>Sam
 
From Help on MsgBox action:<br><br>The following example displays a formatted message box with a sectioned message. The first section of text in the message is displayed as a bold heading. The second section is displayed as plain text beneath that heading. The third section is displayed as plain text beneath the second section, with a blank line between them.<br><br>Enter the following in the Message argument:<br><br>Wrong button!@This button doesn't work.@Try another.<br><br>
 
Well, at least I know that I can read the help files correctly.&nbsp;&nbsp;I have tried that syntax several times in as many ways as I know how and the message box places an <b>@</b> where I want the line feed.<br>&nbsp;<br>Is your suggestion using the MsgBox Action or the MsgBox VB Function?&nbsp;&nbsp;I assume it is the action, because the VB recognizes Char(13) and not &quot;@&quot;.<br><br>Thanks again for the help.
 
Yup, read too fast and I was a little sloppy there. For the function, should've been:<br><br>MsgBox "Wrong button!" & Chr(13) & "This button doesn't work." & Chr(13) & "Try another."


 
My preferred way would be:<br><br>MsgBox &quot;Line 1&quot; & vbCrLf & &quot;Line 2&quot; & vbCrLf & &quot;Line 3&quot;<br><br><br>&nbsp;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top