Why does code Loop

W

Which1

When I click on a command button to show a report I have a break point on the
command_click. Upon clicking the command button it opens a report.

DoCmd.OpenReport stDocName, acPreview

As I step through the code I noticed that as I come to the end sub I expect
the code to stop. But It starts back at the report_activate event and loops
through the code again then opens the form.

Thanks in advance for you help
 
J

Jeff Boyce

If I had to take a guess, opening a report causes more than one event to
fire, and one of those events calls another...

Does this sound like what's happening?

If you'll post the complete code that you're stepping through, maybe someone
here can spot something else...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

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