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 / March 2005

Tip: Looking for answers? Try searching our database.

Default button in message box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Fenton - 10 Mar 2005 20:29 GMT
I'm using the code below in a form control.

 Dim mess As String, answer As String
 mess = "Are you sure you want to change this?"
 answer = MsgBox(mess, vbYesNo, "Subject ID")
 If answer = vbNo Then
   Cancel = True
   Me.Undo
 End If

As it stands, the default button is "Yes", but I want it to be "No".
How do I do that?

Paul Fenton
Jeff Conrad - 10 Mar 2005 21:37 GMT
> I'm using the code below in a form control.
>
[quoted text clipped - 8 lines]
> As it stands, the default button is "Yes", but I want it to be "No".
> How do I do that?

 Dim mess As String, answer As String
 mess = "Are you sure you want to change this?"
 answer = MsgBox(mess, vbYesNo + vbDefaultButton2, "Subject ID")
 If answer = vbNo Then
   Cancel = True
   Me.Undo
 End If

Signature

Jeff Conrad
Access Junkie
Bend, Oregon

Paul Fenton - 11 Mar 2005 02:59 GMT
Jeff, thank you so much!

Paul Fenton
Access Struggler

>> I'm using the code below in a form control.
>>
[quoted text clipped - 16 lines]
>    Me.Undo
>  End If
Jeff Conrad - 11 Mar 2005 04:34 GMT
> Jeff, thank you so much!

You're welcome, glad to help.

> Paul Fenton
> Access Struggler

<g>
Come here more often and you won't be!

We're open almost every day of the year.
(We're closed on the last day of each year for Troll fumigation)

Signature

Jeff Conrad
Access Junkie
Bend, Oregon

 
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.