Yes No message box

  • Thread starter Thread starter Design by Sue
  • Start date Start date
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
 
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...
 
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
 
Back
Top