Start macro, or return to form after answering yes or no (1 Viewer)

AllenK

New member
Local time
Today, 09:29
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:29
Joined
Oct 29, 2018
Messages
21,478
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...
 

CJ_London

Super Moderator
Staff member
Local time
Today, 17:29
Joined
Feb 19, 2013
Messages
16,618
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!
 

Insane_ai

Not Really an A.I.
Local time
Today, 12:29
Joined
Mar 20, 2009
Messages
264
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
 

AllenK

New member
Local time
Today, 09:29
Joined
Aug 30, 2019
Messages
3
WOW!, thank you everyone for the quick response! I will try these and see which one fits my needs the best. Again, thank you!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:29
Joined
Oct 29, 2018
Messages
21,478
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

Top Bottom