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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carriage Returns

Status
Not open for further replies.

Sameal

Programmer
Aug 6, 2001
142
US
Okay I know I've read this sometime in the past but I can't seem to remember. Basically I want to declare some text in a msgbox() carriage return to a newline, and declare some more text. Something like

MsgBox Err.Description & <<<carriage return>>> & &quot;Contact Systems Support Immediately!&quot;, vbCritical, &quot;Error in ErrorLogging&quot;

Thanks I've checked all over help files searching for things such as &quot;carriage return&quot;, &quot;new line&quot;, &quot;hard return&quot;, etc etc... Even looked through character set lists thinking maybe it was a chr() call that made it go to new line.
 
Wohoo... Found it a few minutes after posting under miscellaneous visual basic constants in help.

vbCr or Chr(13) for anyone who has had same question.
 
I think you may actually want vbCrLf or Chr(10) & Chr(13). This does the carriage return and line feed combination. If I am right, and I am frequently not. Carriage return only either sets you to the beginning of the line your on or just goes down a line without returning you to the beginning of the line. The hardest questions always have the easiest answers.
 
Hi!
I alwaus use vbLf ie. Chr(10) in the error message string:

MsgBox &quot;Error No &quot; & err.number & vbLf & Err.Description & vbLf & &quot;Contact Systems Support Immediately!&quot;, vbCritical, me.name & &quot;: FunctionName&quot;

Aivars
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top