View Full Version : Line break and justify in msgbox


anmck
02-18-2009, 08:35 AM
Hi there,

I checked in the help files, but I couldn't get how to format the text as it should appear in a msgbox. For now, the code is:


(...) MsgBox("Text1 Text2", vbYesNo) (...)


But the text appears like this when the box is prompted: (Obviously!)

Text1 Text2

I would like to format it so that it appears as follow, and justified:

Text1
Text2

What is the function for this?

Thanx a lot!

boblarson
02-18-2009, 08:40 AM
For VBA code you add a

& vbCrLf &

in between and it will add a carriage return and line feed. To do it in a query requires the use of the characters:

& Chr(13) & Chr(10) &

in that order.

anmck
02-18-2009, 08:46 AM
Thanx, that does it...

But is there a way to justify and/or center the text in the msgbox?

boblarson
02-18-2009, 08:56 AM
Thanx, that does it...

But is there a way to justify and/or center the text in the msgbox?

No, if you want that you'll have to build your own using a form.