Lawrence Salvucci
asked on
Close Access Report using the timer
I have some users who have a problem leaving a report opened in Preview mode overnight. Trying to tell them not to do that is like talking to a brick wall sometimes. So what I want to do is have the report close the preview window after a specific amount of time. Can this be done when a report is opened in preview mode? This is how I open the report from my form. This form does stay open but in hidden mode until the user actually closes the report. Then the form is unhidden and they can then close the form also. I want to put a timer on the report so it closes after 5 minutes. So how can I set this up on my report?
Here is the code that opens the report from a command button on my form:
And here is the code that unhides the form once the user closes the report preview:
Here is the code that opens the report from a command button on my form:
Dim stDocName As String
TempVars.Add "strBOForm", Me.Name
stDocName = Me.cboReport
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdFitToWindow
Me.Visible = False
And here is the code that unhides the form once the user closes the report preview:
Private Sub Report_Close()
Forms(TempVars!strBOForm).Visible = True
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you both for your prompt responses. I appreciate your help!
lawrence,
if the app is set to automatically close at 1 hour, how can the users keep the report open over night?
Just asking.
Dale
if the app is set to automatically close at 1 hour, how can the users keep the report open over night?
Just asking.
Dale
ASKER
Some of my "power" users don't have the inactivity timer set for their login. But they're the ones that leave this report open overnight. I don't want to put the inactivity timer on their logins for other reasons. Probably should have explained that in my last post.
ASKER
@ Jim - I actually use that article to close down the DB after a certain amount of time. But I wanted this particular report to close after 5 minutes. The inactivity is set for an hour before it closes the DB all together.