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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with DoCmd.OutputTo

Status
Not open for further replies.

legs00

Programmer
Oct 17, 2001
36
CA
Hi! Well I am outputting records to an excel spreadsheet and I am using "DoCmd.OutputTo acOutputQuery". Now when I press the cancel button of that form I get an error:

Run-Time Error: "2501"
the OutputTo action was cancelled

What I would like to know is how to code so that if the cancel button of that OutputTo form is clicked then it will cancel that event or exit that form.
Thank you
Legs
 
I would use flags to know if the process has been completed. Check the flag when canceling out of the form. If the flag has not been set, then cancel the process, then exit the form.

Hope this helps,
Nat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top