Formatting a VBA Message Box

  • Thread starter Thread starter Theman
  • Start date Start date
T

Theman

Guest
Is there anyway to format a message box to wrap long messages instead of building itself horizontally? I would like to view it on the screen and not have to move it which is currently the case. Thanks.
 
It kinda depends on the version of Access you are using but generally inserting a carriage return into message will wrap it like:

MsgBox "Thoughtfully designed and created by the Brothers Smith!" & (Chr(13) & Chr(10)) & " Just because we could!"

Chr(13) is a carriage return
Chr(10) is a line feed

This works in 97. I know you can also use the @ somehow in fact I saw it just recently here but I have always used the other two.

HTH


[This message has been edited by DES (edited 05-15-2001).]
 
I have found vbCrLf better than Chr(13) and chr(10). It is more reliable consistently
 
Hello DES,

I am using the message box in Visio Professional and your solution works great! Thanks.

Hey real begineer,

I am curious; what is vbCrLf and how would you use it in the context of the solution DES proposed? It's always good to have several ways of doing things as a reference. Thanks.
 
vbcrlf = Visual Basic Constant for a combination of a Carriage Return and a Line Feed.

MsgBox "Thoughtfully designed and created by the Brothers Smith!" & (Chr(13) & Chr(10)) & " Just because we could!"

would change to ...

MsgBox "Thoughtfully designed and created by the Brothers Smith!" & vbcrlf & " Just because we could!"


Chris
 

Users who are viewing this thread

Back
Top Bottom