Closing Access

GizmoT

Registered User.
Local time
Today, 13:12
Joined
May 28, 2003
Messages
86
I have a database that records the hours that someone is logged on to it.

Problem is...... for the database to record the time that the User logs off, it requires the User to click on the Exit button. I have removed the control boxes from the form, but there is still a control box in the Access window (if you understand what I mean).

Some Users keep closing the database by clicking on the "x" in the Access window.

How can I stop this from happening?
 
Thanks for that Sam. I see what you mean.

I am sure that there is something of great value in there. I will read it all later, when I have more time.

Appreciate your help!
 
How about create a little, unused form and open it when the Db is opened, maybe when the user logs on with the command line:

DoCmd.OpenForm "yourFormName", , , , , acHidden

This will make it invisible and just sit in the background.

Then do the following:

1.. Create a Public variable in a module somewhere

Public LogUse As Integer

2.. When a user logs on add a line of code that says
LogUse = 1

3..When a user logs off add a line of code that says
LogUse = 0

4.. In the Unload event of the hidden form put

If LogUse = 1 then
Call Log Off Code
End If


This way if the user just hits the access window close button the hidden form will check whether the user has logged off, and if they havent, Log them Off

HTH
Dave
 
That is a good idea, but I really want people to stop logging on and logging off too many times. It is creating so many records in my report. Especially in one of my databases, which is on a stand-alone PC, but can have several people logged on to it at the same time. I use it to work out their hours worked for wages purposes.

At least if they are forced to use the button, I can push up a MsgBox, so that they are aware that they are logging off.
 

Users who are viewing this thread

Back
Top Bottom