Message Box

D

David Tunstall

Please help!

I have a message box with about 30 words and I want to
split the message over 2 rows instead of in one long
string. I know it has something to do with (Chr(10)) or
(Chr(13)) but i'm unsure of how to use it.

Many Thanks
David
 
D

Dirk Goldgar

David Tunstall said:
Please help!

I have a message box with about 30 words and I want to
split the message over 2 rows instead of in one long
string. I know it has something to do with (Chr(10)) or
(Chr(13)) but i'm unsure of how to use it.


MsgBox "This is the first line." & vbCr & _
"This is the second line."

You can also do it by inserting any of these:

vbCrLf
vbNewLine
Chr(13)
Chr(13) & Chr(10)
 
D

David T

Thanks very much!
-----Original Message-----



MsgBox "This is the first line." & vbCr & _
"This is the second line."

You can also do it by inserting any of these:

vbCrLf
vbNewLine
Chr(13)
Chr(13) & Chr(10)

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
 
A

Andy Korth

MsgBox "Here is one line" & (chr(13) & "Here is another!"

That's all there is to it.

Andy
 
P

Peter

You can also use the following code which I use if there
is no data in a report. The message box comes up on two
lines.

Private Sub Report_NoData(Cancel As Integer)
MsgBox "No data found! Closing report." _
& "Please try another value.", vbExclamation
Cancel = True
End Sub
 
D

Dirk Goldgar

Peter said:
You can also use the following code which I use if there
is no data in a report. The message box comes up on two
lines.

Private Sub Report_NoData(Cancel As Integer)
MsgBox "No data found! Closing report." _
& "Please try another value.", vbExclamation
Cancel = True
End Sub

I can see no reason why that message would come up on two lines, and it
certainly doesn't for me. Are you sure you didn't leave a new-line
character out?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top