Message Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to centre text in a message box when displaying more than one
line in a message?

Thanks

Dave
 
Is it possible to centre text in a message box when displaying more than one
line in a message?

Thanks

Dave

Well, I've come close by padding the text with spaces, but a better
solution, if this is of importance to you, would be to create your own
unbound form with a label to display your message. Set the label's
Text Align property to Centered. Leave it's caption blank.

You would open the form like this:
DoCmd.OpenForm "MessageFormName", , , , , acDialog, "This is the text
of the message"

Code the Form's Load event:

If Not IsNull(Me.OpenArgs) Then
Me.LabelName.Caption = Me.OpenArgs
End If

This way you could use the same form to display different messages,
depending upon the OpenArgs passed to it.

Add a Command Button to close the form:
DoCmd.Close acForm, Me.Name
 
Thanks Fred - this works great. I'll use this way to display messages from
now on.

Thanks again,

Dave
 
Dave said:
Thanks Fred - this works great. I'll use this way to display messages
from now on.

Indeed. I created a custom message box for the specific reason that users
simply do not read anything that looks like a standard Windows message box. Oh
they "might" let you know that they saw one when using your app, but when you
ask them what it said they have no idea.

The appearance of messages and errors in Windows and Windows programs has simply
become background noise to most users. They close them with the same amount of
attention they would give to shooshing a fly off of their screen.

I made my message box conspicuously different and find that the vast majority of
the time it does actually get read.
 
Back
Top