Start macro, or return to form after answering yes or no

AllenK

New member
Local time
, 19:53
Joined
Aug 30, 2019
Messages
3
I have a button on a form which will start several macros in order. Button is not used frequently. Before clicking on the button, links to files need to be updated. When clicking on the button, I want a pop up box to open first asking the user if they updated the link. Yes would then start the macro, a no answer would close the box and return to the form. I hope I have posted my question in the proper forum, forgive me if wrong and steer me in proper direction. I am still new to Access, so examples of code I can copy and paste would be fantastic.
Thanks everyone. AllenK
 
Hi AllenK. It might look something like this:
Code:
If MsgBox("Are you sure?", vbYesNo,"Confirm")=vbYes Then
    'run macros
End If
Hope it helps...
 
code would be something like

Code:
if msgbox("have you updated the link?",vbyesno)=vbyes then
    run your macros
end if
return to form

edit - beaten to it!
 
try something like this:

Code:
Dim varResponse As Variant
varResponse = MsgBox("Have you updated the link yet?", vbYesNo, "My Title here")
    If varResponse = vbYes Then
        'run macros
    Else
        Exit Sub
    End If
Edit:
Beaten to the finish line
 
WOW!, thank you everyone for the quick response! I will try these and see which one fits my needs the best. Again, thank you!
 
WOW!, thank you everyone for the quick response! I will try these and see which one fits my needs the best. Again, thank you!
Hi. You're welcome. We're all happy to assist. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom