Message Boxes

Oldsoftboss

AWF VIP
Local time
Today, 21:56
Joined
Oct 28, 2001
Messages
2,499
Am I able to format a message box to give 2 lines of text as my message is rather long and messy. I saw in the northwind db the use of the "My message is rather long"&_
"to display on one line" but when I tried it the text was added together on one line.
I then tries the use of the @ symbol demonstrated in the help files but the message only added the @ to the message ie:
My message@is long.
Any ideas or am I coding incorrectly
Thanks, Dave
 
Try "My message is rather long" & chr(13) &_
"to display on one line"

chr(13) or chr$(13) causes a new line to be inserted.

Regards.
 
Jo, thanks for your promp reply. When I write the message in the code and inset the &_ I get an error message saying "compile error" - "Invalid Character"
 
Sorry, I was a bit quick to reply to your post joe, typed it all on one line and it worked OK. Thanks.
Next question is how to centre it !!
Will keep fiddling.
Cheers
 
There is no way to centre the text in a message box. The only workaround is to build a custom message box form, with an OK button on it.

Ian

PS. You can also do this to put a carriage return in.

"My name is " & vbCrLf & "IAN"

vbCrLf is the VisualBasicCarriageReturnLeFt constant.

Ian


[This message has been edited by Fornatian (edited 11-04-2001).]
 
Additionally, if you work with A2k, you cannot use @ to embolden (is that a word?) part of your message string.
I know, in A97 you could (maybe you could comment on that, Rich?
wink.gif
)

There is a workaround using the Eval function though. See:
http://www.trigeminal.com/usenet/usenet015.asp?1033

Alex

[This message has been edited by Alexandre (edited 11-04-2001).]
 
Alexandre, I agree that you can not use the @ symbol to format a messagebox in VBA using Access 2000/2002 ... but you can still use it in a macro.

"Just thought I'd mention this ...."

RDH
 
Thanks all for replies. I got aroung the centring issue by adding spaces ie:
"The first line is fairly long"& chr(13) &_"........the second short"
It was trial & error to move the two lines to the centre of the message box but the result is what I was after. Thanks once again.

[This message has been edited by Oldsoftboss (edited 11-05-2001).]
 
R Hicks,

Thanks for the tip. I didn t know it could be done with macros. I don t use them much but should probably take some time to see what can be done with them to facilitate my life
smile.gif


Alex
 
I never use macros myself. I just wanted to bring up the point that the formatting of the MessageBox could still be performed by using a macro.

RDH
 

Users who are viewing this thread

Back
Top Bottom