Conditional action after a MsgBox

G

Glen B

I am writing a long Macro that will action a number of append and delete
Queries. I want to start with a warning in a MsgBox explaining the
consequences, then allow the user to select OK to continue the Macro or
Cancel to end the macro at this point, but I'm afraid I can't see how to do
it.

Any help would be much appriecated.
 
K

KARL DEWEY

Have your macro call a small form that has your message and a checkbox to
continue and another to stop.
Then have condition --
[Forms]![YourMessageForm]![YourCheckBoxContinue] = 0
Have action Close YourMessageForm
Then have condition --
[Forms]![YourMessageForm]![YourCheckBoxContinue] = 0
StopMacro.
Have action Close YourMessageForm
 
W

Wolfgang Kais

Hello Glen.

Glen B said:
I am writing a long Macro that will action a number of append and
delete Queries. I want to start with a warning in a MsgBox explaining
the consequences, then allow the user to select OK to continue the
Macro or Cancel to end the macro at this point, but I'm afraid I can't
see how to do it.

Any help would be much appriecated.

At the beginning choose the StopMacro action with a condition like this:
(Use the view menu to display the conditions column)
MsgBox("Dear user...", 305, "Warning!") <> 1

Explanation: See onlone help for the MsgBox function.
 
K

KARL DEWEY

Igot in a hurrry and did notr edit after pasting --
Have your macro call a small form that has your message and a checkbox to
continue and another to stop.

Then have condition --
[Forms]![YourMessageForm]![YourCheckBoxContinue] = -1
Have action Close YourMessageForm

Then have condition --
[Forms]![YourMessageForm]![YourCheckBoxStop] = -1
Have action Close YourMessageForm

Then have condition --
[Forms]![YourMessageForm]![YourCheckBoxStop] = -1
Have action StopMacro.




KARL DEWEY said:
Have your macro call a small form that has your message and a checkbox to
continue and another to stop.
Then have condition --
[Forms]![YourMessageForm]![YourCheckBoxContinue] = 0
Have action Close YourMessageForm
Then have condition --
[Forms]![YourMessageForm]![YourCheckBoxContinue] = 0
StopMacro.
Have action Close YourMessageForm

Glen B said:
I am writing a long Macro that will action a number of append and delete
Queries. I want to start with a warning in a MsgBox explaining the
consequences, then allow the user to select OK to continue the Macro or
Cancel to end the macro at this point, but I'm afraid I can't see how to do
it.

Any help would be much appriecated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top