Msg Box

peterbowles

Registered User.
Local time
Today, 05:46
Joined
Oct 11, 2002
Messages
163
I have a button that updates a field I want a message to appear to the user to allow them to selet Ok to change the field or Cancel to do nothing.

I also want to insert a file path from a field on my form called Image Path

Any help

Thanks in advance
 
Hey Peter,

to start you off go into the code part of your command button. You'll want to type in something like this:

Private Sub Command0_Click()
If MsgBox("Are you sure....?", vbYesNo) = vbYes Then
'action to perform
Else
MsgBox "Aborted!"
End If
End Sub

If you follow the logic here, the first line asks if they are sure (the vbYesNo is a type of button, one that displays two buttons on the message box). If that equals yes, then do the action. If it doesn't (meaning the user selected no) then skip then just display the message aborted).

Hope that helps!

-Sean
 

Users who are viewing this thread

Back
Top Bottom