Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-12-2008, 01:12 PM   #1
Tony1949
Registered User
 
Join Date: Jan 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Tony1949 is on a distinguished road
Access 2007 Report Timer Event

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.

Tony1949 is offline   Reply With Quote
Old 08-12-2008, 02:11 PM   #2
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 33,296
Thanks: 13
Thanked 4,112 Times in 4,044 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
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.
__________________
Paul
Microsoft Access MVP 2007-2019

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Old 08-12-2008, 03:08 PM   #3
Mike375
Guest
 
Posts: n/a
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.

  Reply With Quote
Old 08-13-2008, 08:23 AM   #4
Tony1949
Registered User
 
Join Date: Jan 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Tony1949 is on a distinguished road
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.
Tony1949 is offline   Reply With Quote
Old 08-13-2008, 08:25 AM   #5
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 33,296
Thanks: 13
Thanked 4,112 Times in 4,044 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
And I managed to miss my thumb!

Glad it helped you out.
__________________
Paul
Microsoft Access MVP 2007-2019

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Old 12-23-2012, 10:44 AM   #6
dclosure
Newly Registered User
 
Join Date: Aug 2012
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
dclosure is on a distinguished road
Re: Access 2007 Report Timer Event

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.

dclosure is offline   Reply With Quote
Reply

Tags
2007 , event , preview , report , timer

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling LabVIEW Shared Library (dll) causes Access 2007 to hang brents1 Modules & VBA 2 01-19-2009 07:23 PM
On Current Event Procedure (on form) - Access 2007 arcticSky Modules & VBA 2 06-26-2008 08:36 PM
Access 2007 -> Access 2003 runtime downgrade camilovic General 0 02-29-2008 07:52 AM
OCX distribution - Access 2007 rtdgreg Forms 0 02-04-2008 02:36 AM




All times are GMT -8. The time now is 04:31 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World