Access 2007 Report Timer Event (1 Viewer)

Tony1949

New member
Local time
Today, 07:36
Joined
Jan 24, 2008
Messages
6
I have a database which allows a user to open a report in preview mode. The user then has the option whether or not print it.

I am trying to use the report's timer event to automatically close the report after a predetemined period of inactivity as users have a habit of leaving reports open when they go home.

My attempts to date suggest that the report timer event does not fire in report preview mode. Can anybody confirm or refute this, please?

In a simple test I have set the timer interval to 5000 and created a timer event which merely displays a message using MsgBox. The MsgBox text is not being displayed which tells me that the Timer event is not firing.

All suggestions welcomed!

Regards, Tony.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:36
Joined
Aug 30, 2003
Messages
36,125
I was hoping someone else would answer, as the PC I'm on doesn't have 2007 on it. I know there are differences between preview mode and the new report view or whatever it's called. For instance, in preview mode you can use the section format events to control formatting and such, but in report view those events do not fire (found that out the hard way). It would not surprise me if the timer event only fired when in report view. You might try opening it in that view and see if your message box fires then.
 
M

Mike375

Guest
Is there some code that could open the Report in preview mode and also open a hidden form and the form has the timer event to close both itself and the report.
 

Tony1949

New member
Local time
Today, 07:36
Joined
Jan 24, 2008
Messages
6
Response to replies!

pbaldy: You have hit the nail on the head! I have always opened my reports in VBA using the acViewPreview option - and this option does not fire the OnTimer event. I have just tried opening the report using the acViewReport option - and the OnTimer event is now firing. Thank you very much for your reply.

Mike375: You deserve the runners up prize! I was afraid that I would have to code something along the lines you suggested. It was good to hear the same idea coming from somebody else! Thanks for your reply.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:36
Joined
Aug 30, 2003
Messages
36,125
And I managed to miss my thumb! :D

Glad it helped you out.
 

dclosure

Registered User.
Local time
Today, 01:36
Joined
Aug 23, 2012
Messages
12
Try using the timer event of a hidden form to act as the report timer in preview mode. I've had it in production for about a month now in an application with heavy use and it's working very well. In the report open event a hidden form which has no controls and only a couple of events is opened. When the timer event of the hidden form reaches its limit it opens a small form where the user can choose to keep the report open or let it close. If no response, the report is closed. In the report close event the hidden form is closed.
 

Users who are viewing this thread

Top Bottom