How to start new line in an message window

accessfever

Registered User.
Local time
Today, 10:07
Joined
Feb 7, 2010
Messages
101
Hi, I use a msgbox for a message in a macro. The message is something like this: "Hi user, please make sure you have updated the run date first". The msgbox will have this statement on one line in the pop up window. I wonder if there is a way to split this statement into two lines like this:

Hi user,
Please make sure you have updated the run date first.

Any idea?
 
I don't really know in macros because I don't use them but in VBA you do this:
"Hi user," & vbCrLf & "Please make sure you have updated the run date first."

If that doesn't work try:
"Hi user," & Chr(13) & Chr(10) & "Please make sure you have updated the run date first.".

Or maybe even this would do:
"Hi user," & Chr(10) & "Please make sure you have updated the run date first."
 
Macros have very limited msgbox support. Better to do them in VB.

Code:
("First line of text." & vbNewLine & _
"Second line of text on new line" & vbNewLine & vbNewLine & _
"Third line of text in a new paragraph.")
 
The answer is Galaxiom's second response:
GalaxiomAtHome said:
"Hi user," & Chr(13) & Chr(10) & "Please make sure you have updated the run date first.".

And while macros are still not quite as powerful as VBA, in 2010 they are much more enhanced than ever before and using them, instead of VBA, can provide a way to make your database run without needing to set it as trusted or in a trusted location (depending on what you need to do).

So, where I would have normally pushed for VBA, I don't as much now. If macros do what you need, and you are comfortable with them, there's no reason to avoid them.

If you find you can't do something with them then of course VBA is likely your only option. But again, it depends on who you are and what your database is doing and needs to do which can determine what you need. (key word - NEED) :D
 
I understand the advantage of sticking to macros avoiding the security issue. However it only takes one little bit of VBA to completely destroy that advantage.

Aiming to avoid VBA is setting a goal that will limit the feature set of the database and can make it harder to achieve stuff that is quite straightforward in VBA.

How many times do we knock up something minimalist on advice from the client that it is only to fill a simple need and then start receiving requests for more features that simply can't be done in a macro. Then all the effort to avoid VBA in the first place is wasted.

Besides, once the security measures are in place for one database, any subsequent database is easily configured to join that regime.
 
And then there are those databases for which users find macros give them enough flexibility and they don't either have the time nor the desire to learn VBA. Not all databases are ones which require such an investment. Yes, many do, but I worked for 4 years (successfully I might add) using only macros before I took the plunge. Of course I didn't have anyone as patient as many of the users on the board for teaching it so I was stuck learning it myself when I WAS READY. :D
 
Thanks everyone's comments. The Chr() function really does the trick for me. Thanks!
 

Users who are viewing this thread

Back
Top Bottom