Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / December 2007

Tip: Looking for answers? Try searching our database.

Yes No message box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Design by Sue - 31 Dec 2007 19:20 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
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.