Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing tab order in a MsgBox

Status
Not open for further replies.

rushdib

Programmer
Jun 12, 2001
203
US
The MsgBox I created in VBA using MsgBox function has two buttons, 'Yes' and 'No'. The default is 'Yes' when the user presses the enter key. How do I change the default to 'No'?
 
In the code for the message box, the second parameter is for setting number of buttons, whether an icon is displayed (STOP, Question Mark etc) and which button is the default one. You can add these together so you will get something like:

Code:
Response = msgbox("Do you want to continue?", vbYesNo + vbQuestion + vbDefault2)

This will set the second button as the default one. Alex Middleton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top