Avatar of kingsbishop
kingsbishop
 asked on

Report events not being triggered

Question by:  Pelegrinus On 2012-08-07 01:24 PM https://www.experts-exchange.com/questions/27820593/Opening-an-Access-Report-in-acViewNormal-Doesn't-Trigger-Report-Events.html
I hope this is enough information to let you know the question I am responding to. What I stumbled on is that if a global variable is used within the on open procedure the code will execute even when a report is printed. In a module I placed the following code:
global gbdone as boolean
then inside the on open procedure I placed the the following code, along with the other code I wanted to execute:
gbdone = false
and every thing executes

Thanks for making all this information available to us. (Microsoft sure is not much help most of the time.)
Microsoft AccessProgramming

Avatar of undefined
Last Comment
Nick67

8/22/2022 - Mon
Nick67

That's interesting and I'll have to check out its implications.
The original was here
https://www.experts-exchange.com/questions/27820593/Opening-an-Access-Report-in-acViewNormal-Doesn't-Trigger-Report-Events.html
It's not that the Report_Open code doesn't function at all, but breakpoints definitely don't work, and attempts to set .Caption fail -- and since .Caption is the name given to the job in the print queue, and the default name given to the PDF file -- being able to set .Caption successfully is pretty damn important!

I have done that by opening with DoCmd.OpenReport stDocName, acViewPreview and, with the Report open, then printing it out -- but it is more time-consuming than a straight DoCmd.OpenReport stDocName, acNormal to do it that way.

Interesting!
SOLUTION
Jeffrey Coachman

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Nick67

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Jeffrey Coachman

Yes,
Very interesting...
Nick67

Close it with zero points.
It wasn't a Q per se, but there is content here worth preserving

Nick67
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck