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.)
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.)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes,
Very interesting...
Very interesting...
Close it with zero points.
It wasn't a Q per se, but there is content here worth preserving
Nick67
It wasn't a Q per se, but there is content here worth preserving
Nick67
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!