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
Albert D. Kallal - 31 Dec 2007 19:58 GMT
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...

Signature
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
Stuart McCall - 31 Dec 2007 20:02 GMT
> 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
Design by Sue - 31 Dec 2007 20:27 GMT
Thanks to both of you - that did what I needed.
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
[quoted text clipped - 9 lines]
>
> vbQuestion + vbYesNo + vbDefaultButton2