Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Message Box to Control Action taken

Status
Not open for further replies.

RBPM

IS-IT--Management
Joined
Jan 14, 2005
Messages
59
Location
US
Good afternoon to the forum.

I am sure this is pretty basic, but I can seem to get it to work and am hoping that someone can help me out.

I am trying to use a message box to ensure that the next step that is taken is really what is wanted. If not want to return to the form that it was called from.

Step 1 Display meassage and ok or cancel

Step 2 if ok pressed update two fields and display message that says that action is taken.

Step 3 If cancel pressed - no action taken message displayed and return to form.

Can anyone share the code to do this with?

Any help would be greatly appreciated.

Thanks

 
Something like.....

If MsgBox("Display your message here.", vbOKCancel, "Title") = vbOK Then
do the OK button stuff
Else
do the Cancel button stuff
End If



Randy
 
And what have you tried so far ?
Have a look in the VBA help at the MsgBox function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for the replies. Randy - It worked like a champ. PH thanks for the reference. As usual I was doing something dumb. Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top