set default to no in msgbox with vbyesno

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
 
B

Brendan Reynolds

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.
 
R

Rick Brandt

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top