MsgBox() size and size of buttons

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

Guest

Is there a way to change the size of the default MsgBox() and the size of the
buttons?
 
pokdbz said:
Is there a way to change the size of the default MsgBox() and the
size of the buttons?

The size of the box changes with the amount of text to be displayed.
The sizes of the buttons are fixed and you can't change them without
(maybe) doing some fancy programming with the Windows API. However, you
can create your own dialog form, formatted however you like, and display
it in place of the built-in MsgBox.
 
Is there a way to change the size of the default MsgBox() and the size of the
buttons?

No.
You can create your own unbound form to use as a message box.
You can size the buttons any way you like.
Add a command button to the form.
Code it's Click event:
Me.Visible = False

You call the message form using something like this:

Dim strMessage as String
strMessage = "this is your message"

DoCmd.OpenForm "MessageFormName", , , , ,acDialog, strMessage
' You can do additional stuff here.
DoCmd.Close acForm, "MessageFormName"

Code the Form's Load event:
If Not IsNull(Me.OpenArgs) Then
LabelOnForm.Caption = Me.OpenArgs
End If

The form will display your message until you click the command button
to hide the message. Then the code will continue and close the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top