MsgBox() size and size of buttons

P

pokdbz

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

Dirk Goldgar

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.
 
F

fredg

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.
 
Top