What's wrong with this message box?

Big Pat

Registered User.
Local time
Today, 20:53
Joined
Sep 29, 2004
Messages
555
Hi,

I'm just dipping my toe into message boxes, never really having had a need for them before. What have I done wroing in the following?

Code:
MsgBox ("That's not a Monday." & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "ALWAYS enter a Monday, even if the data was downloaded on a different day for any reason.",vbCritical,"Check the date")
The following DOES work, but I want to give the message a title and the critical icon.
Code:
MsgBox "That's not a Monday." & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "ALWAYS enter a Monday, even if the data was downloaded on a different day for any reason."
After reading help, the first version above is what I came up with but the error message reads "Compile error: Expected: = " And I'm afraid i don't understand that!

I don't want to give the user any choices at this point. The next lines of code set the previous entry to Null and move the focus back to the input box, which works fine.

Thanks.
 
Try:
Code:
MsgBox "That's not a Monday." & vbCrLf & vbCrLf  & "ALWAYS enter a Monday, even if the data was downloaded on a different day for any reason.",vbCritical,"Check the date"
 
Thanks Bob. That works a treat! So no brackets required then? Now where did I get the idea I needed those?

Note to self...*MUST read help more carefully*

Thank you :)
 
Thanks Bob. That works a treat! So no brackets required then? Now where did I get the idea I needed those?

Note to self...*MUST read help more carefully*

Thank you :)
I think I'm right in saying that Msgbox just displays the message box but Msgbox() is a function that returns in integer value dependent on which button the user clicks in the message box.
 

Users who are viewing this thread

Back
Top Bottom