Add a Message Box to an existing command button

mixup

Registered User.
Local time
Today, 14:32
Joined
Jul 29, 2005
Messages
34
I have a "Browse" button on a form that works fine. I would like to add a Message Box that warns the user that if they click "ok" on the message box they will start browsing, and if they dont want to do that click "cancel" in the message box. ( I know its obvious, bu thats what my friend wants). Is there an easy way to do this?
 
Hey Mixup,

You could do something like this behind the command button:

If Msgbox "Your message here",4,"TitleBarMessageHere = vbNo Then
Exit Sub
Else
'Let them go ahead and browse
Exit Sub

HTH,
Shane
 
Thanks Shane, I did something similar and that worked.

If MsgBox("Message", vbOKCancel + vbQuestion, "Confirm") = vbOK Then

I got the idea from a previous post.

Thanks though.

Mixup
 

Users who are viewing this thread

Back
Top Bottom