Link to home
Start Free TrialLog in
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.)
Avatar of Nick67
Nick67
Flag of Canada image

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
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes,
Very interesting...
Close it with zero points.
It wasn't a Q per se, but there is content here worth preserving

Nick67