Change button text in msgbox window

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

Is it possible to change button text different from yes,
no, cancel... in msgbox window?

Tahnk you
 
Hi, Alex.
Is it possible to change button text different from yes,
no, cancel... in msgbox window?

Yes. If the"Auto List Members" check box is checked in the VB Editor
options, then a drop down list of the many values available will be
displayed as you type your code for the MsgBox function. You may also open
the Object Browser and check the names of the members of VbMsgBoxStyle from
the VBA library for this list.

You may use multiple values on this list to further customize the message
displayed for your user. The following example will display an exclamation
point icon, the "Retry" button, the "Cancel" button, and default to the
"Cancel" button -- instead of the first button listed. It will also use
"Saving File" as the MsgBox window title.

MsgBox "Attempt to save file failed." & _
vbCrLf & vbCrLf & "Try again?", _
vbExclamation + vbRetryCancel + vbDefaultButton2, _
"Saving File"

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
Is it possible to change button text different from yes,
no, cancel... in msgbox window?

Tahnk you

Change the text to what?
If you want different built in buttons, there is no problem.
After entering the message text add a comma. The VBA intellisense will
offer a drop down of the available buttons. Choose one.

If you wish wholly different text, then no you cannot.
Create your own unbound form as a message box. You can use any command
button caption text you wish.
 

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