Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close Report After Time Interval

Status
Not open for further replies.

ajrimmer

Technical User
Jan 24, 2003
77
GB
I have an Access 97 database I've inherited where 'problems' are being created by people opening reports & then leaving these open (while they go off for lunch).

Whilst I sort out the intrinsic problems with this DB (ie rewrite from scratch) does anybody know of a way of getting a report to close after a suitable time lapse (say 5 minutes)?

My first try was along the lines of:

Private Sub Report_Open(Cancel As Integer)
Dim sec
sec = Timer
Do
If Timer - sec > 300 Then
DoCmd.Close acReport, "Main Data Query", acSaveNo
End If
Loop
End Sub

The problem here is the report never actually opens (which does sort of make sense).

Any ideas? Thanks in advance.
 
You can't do that with a report alone.
You need a form to record opening time and use the OnTimer event of that form to close the report.

ftp://ftp.artrom.ro/AccessLogout.zip

quits the entire database after 30 minutes of inactivity.

HTH


[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top