Help in VBA code on Wizard cancel by user. (1 Viewer)

mahenkj2

Registered User.
Local time
Today, 06:15
Joined
Apr 20, 2012
Messages
459
I am using following code in my dB.

DoCmd.SelectObject acTable, "tblUsers", True
DoCmd.RunCommand acCmdCollectDataViaEmail

Works fine. But I have further actions involved after this code. If user press Next on the wizard opened by second line of code and progresses further, then it is how I need.

In case, user cancels the wizard opened by second line of code, still my code progresses which I do not want. I need to halt the operation then. How can I do this. I need to check if at any stage, wizard is canceled.

Any suggestions please.
 

pr2-eugin

Super Moderator
Local time
Today, 01:45
Joined
Nov 30, 2011
Messages
8,494
Why not use a MsgBox and based on the response go for the next line..? something like..
Code:
DoCmd.SelectObject acTable, "tblUsers", True
If MsgBox("Do you wish to email?",vbYesNo)=vbYes Then DoCmd.RunCommand acCmdCollectDataViaEmail
 

mahenkj2

Registered User.
Local time
Today, 06:15
Joined
Apr 20, 2012
Messages
459
Yes Paul,

That's a good idea.

I am working on adding this feature for last five days and so I need to refresh my mind. I will give this a go and in case it require some more automation I will come back.
 

Users who are viewing this thread

Top Bottom