Msgbox YesNo

J

juicegully

Hi,

My message box is this:
Response = MsgBox("Would you like to enter a new date?", vbYesNo)

How do I get the default value to be No instead of Yes?

Thanks
 
F

fredg

Hi,

My message box is this:
Response = MsgBox("Would you like to enter a new date?", vbYesNo)

How do I get the default value to be No instead of Yes?

Thanks

Response = MsgBox("Would you ... date?, vbYesNo + vbDefaultButton2)
 
J

juicegully

OHHH okay I'll use that. The Help section on my computer isn't working
propertly and all the links are broken
Thanks!
 
J

juicegully

I think I need vbDefaultButton2 but using "vbYesNo & vbDefaultButton2"
doesn't work properly
 
6

'69 Camaro

Hi.

Try:

Response = MsgBox("Would you like to enter a new date?", vbYesNo +
vbDefaultButton2)

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.
 
F

fredg

I think I need vbDefaultButton2 but using "vbYesNo & vbDefaultButton2"
doesn't work properly

You are correct.
vbYesNo & vbDefaultButton2 won't work. :-(
But... if you use
vbYesNo + vbDefaultButton2
it will.
Re-read my original response. :)
 
Top