Yes No message box

D

Design by Sue

Is it possible to change the YesNo message box so No is the default
selection? (So when the user clicks enter, it does the No code? It is
standard the the Yes button is the default.
Thanks
Sue
 
A

Albert D. Kallal

As you type in the parameters for the msgbox, you can hit ctrl-j, and a
"drop
down" list of constants will appear.

note that you can use the + key to "string" together the parameters...(and
you
can repeatedly hit ctrl-j to get the list).


Thus, try:

if msgbox("Delete this record", _
vbQuestion + vbDefaultButton2 + vbYesNo, _
"Delete?") = vbYes then

Note that adding vbQuestion makes the msgbox look rather nice.....try it....

The above likey could be on one line...but, I wrapped it for newsgroup
posting...
 
S

Stuart McCall

Design by Sue said:
Is it possible to change the YesNo message box so No is the default
selection? (So when the user clicks enter, it does the No code? It is
standard the the Yes button is the default.
Thanks
Sue

Sure. Just add the following const:

vbDefaultButton2

to the buttons argument, eg:

vbQuestion + vbYesNo + vbDefaultButton2
 

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

Top