Can someone please help?

MICHELE

Registered User.
Local time
Today, 14:03
Joined
Jul 6, 2000
Messages
117
I am trying so hard to force users out of the database after a certain time by making a docmd.quit on the opening of my startup form with a timer. I've tried to be creative but nothing works. Does anyone have any ideas?
I have setup a table with a sysquit time and sysavailable time and I'm trying to compare it with an unbound field on my form that pulls up the current time.
Any ideas?
 
This should work, but I have not spent a lot of time testing it....

Create a form with one text field on it. In the On Activate event put code similar to this: Me.TextBoxName = Time()

In the On Timer event of the form but code similar to this:

Dim T As Variant

T = Format([TextBoxName] - 1 - Time(), "Short Time")
If T >= "00:10" Then
MsgBox "Your Time Is Up!"
DoCmd.Quit
End If

In the above code if the time is set for 10 minutes.

Set the Timer Interval to 60000 to check it every one minute.

Set the form to open when the database is opened and then minimize it or otherwise keep it out of sight behind other forms so the user cannot close it.

I hope this at least gives you some ideas.... Good Luck!

[This message has been edited by Jack Cowley (edited 05-30-2001).]
 
It works! I did the code a little different. Thank you for the push!
 

Users who are viewing this thread

Back
Top Bottom