Why does code Loop

  • Thread starter Thread starter Which1
  • Start date Start date
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
 
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.
 
Thanks Jeff,

I put in a msgbox and ran the code without stepping thourgh and it ran fine.
 
Back
Top