set default to no in msgbox with vbyesno

  • Thread starter Thread starter Reiner Harmgardt
  • Start date Start date
R

Reiner Harmgardt

Hi NG

i want to call a decision from a user via the following msgbox:

ans = msgbox ("Do you want to delete this record?", vbyesno)

right now yes is setup as default.
is there a possibility to change the default to no?
it's to prevent the user from deleting the record
when just pushing ENTER without having thought about the impact.


Thanks for helping.

Regards

Reiner
 
MsgBox "Yes or no?", vbYesNo Or vbQuestion Or vbDefaultButton2

vbDefaultButton1 makes the first button the default, vbDefaultButton2 makes
the second button the default, and so-on up to vbDefaultButton4.
 
Reiner said:
Hi NG

i want to call a decision from a user via the following msgbox:

ans = msgbox ("Do you want to delete this record?", vbyesno)

right now yes is setup as default.
is there a possibility to change the default to no?
it's to prevent the user from deleting the record
when just pushing ENTER without having thought about the impact.


Thanks for helping.

Regards

Reiner

ans = msgbox ("Do you want to delete this record?", vbYesNo + vbDefaultButton2)
 
Back
Top