Question One:
When entering lengthy notes in the VB screen, how do I put a line break in
that does't mess up the code? I'm really just asking for a line break to
make it easier for me to enter and edit the message box text.
Question Two:
What is the code I use to name the message box; the text in the blue header
of the message box?
Thanks for your answers!
Wayne Morgan - 12 Dec 2005 23:24 GMT
1) You may find it easier to place the text into a variable then use the
variable in the MsgBox.
Example:
strMsg = "This is a long message." & vbCrLf & "That needs a line break"
MsgBox strMsg, vbOkOnly + vbExclamation, "My Message Box"
or, if you need a return value:
lngRetValue = MsgBox(strMsg, vbYesNo + vbQuestion, "My Message Box")
vbCrLf is a built-in constant for Carraige Return/Line Feed. You could also
concatenate in two Chr() functions with the appropriate character numbers,
but the constant is easier. Another option, if you have a really long
message, is to break up the message into multiple lines as you assign it to
the variable.
Example:
strMsg = "This is a long message." & vbCrLf & "That needs a line break"
strMsg = strMsg & vbCrLf & "I decided to add a third line."
2) Adding text to the blue title bar of the message box is done by the last
argument in the example above. In this case, the blue title bar will show
"My Message Box" (without the quotes).

Signature
Wayne Morgan
MS Access MVP
> Question One:
> When entering lengthy notes in the VB screen, how do I put a line break in
[quoted text clipped - 7 lines]
>
> Thanks for your answers!
John - 12 Dec 2005 23:26 GMT
Hi,
I know it's cheating but download this nifty little utilty from Arvin Meyers
site.
http://www.datastrat.com/Download/MsgBox.zip
regards
John
> Question One:
> When entering lengthy notes in the VB screen, how do I put a line break in
[quoted text clipped - 7 lines]
>
> Thanks for your answers!
fredg - 13 Dec 2005 00:05 GMT
> Question One:
> When entering lengthy notes in the VB screen, how do I put a line break in
[quoted text clipped - 6 lines]
>
> Thanks for your answers!
I think your referring to the text in the code window itself, not in
the displayed message box itself, correct?
Add a space and underscore at the end of your code line, then continue
on the next line.
MsgBox "This is a very long line on the screen." _
& "This is on the next line."
The above will appear all on one line in the message itself.

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Glenn in Los Angeles - 13 Dec 2005 00:59 GMT
Yes, that's exactly what I was looking for. Thanks,
> > Question One:
> > When entering lengthy notes in the VB screen, how do I put a line break in
[quoted text clipped - 16 lines]
> & "This is on the next line."
> The above will appear all on one line in the message itself.