Prevent user from closing Access

C

Claes

Hello.

My database doesnt need to much security.
I have, instead of Access security, made my own popupform for people to
login at startup.
When they login or logoff changes are made in a table.
I can always see who are logged in, and get nice statistics.
The username is also used to record who makes changes in the records.
The users are supposed to use the button I have put on the switch when they
want to close Access.
When doing that, their action is logged, and everything is fine.

The problem is that even if I told everyone hundreds of times, they
sometimes use the Access closebutton in the top right corner.
When they use this, the event isnt logged, and people appear logged in even
if they are not.

Is there any way to make the Access closebutton "unclickable"?
Or if you have any other ideas on how to prevent users from using the "x"
then I would be grateful to hear them.

BR
Claes
 
R

Rick B

Tying that function to a button requires them to click the button. Why not
tie the logoff function to an "onclose" event in a form? Then, when that
form closes, the event is logged.

If you don't have a form (like a switchboard) that is always open, simply
make on and have it auto-open with the database. Then, make it hidden. The
user won't know it is there, but when the database is closed (and the form
is closed) the event will run.

Rick B
 
R

Rick Brandt

Claes said:
Hello.

My database doesnt need to much security.
I have, instead of Access security, made my own popupform for people to
login at startup.
When they login or logoff changes are made in a table.
I can always see who are logged in, and get nice statistics.
The username is also used to record who makes changes in the records.
The users are supposed to use the button I have put on the switch when they
want to close Access.
When doing that, their action is logged, and everything is fine.

The problem is that even if I told everyone hundreds of times, they
sometimes use the Access closebutton in the top right corner.
When they use this, the event isnt logged, and people appear logged in even
if they are not.

Is there any way to make the Access closebutton "unclickable"?
Or if you have any other ideas on how to prevent users from using the "x"
then I would be grateful to hear them.

Have a small form open up (hidden) at startup and put your "clean up" code in
that form's close event. It will fire no matter how they close Access (short of
the reset/power button).
 
J

Jeff Conrad

Hi,

I use these techniques. They work great.
Take your pick based on version.

ACC: How to Disable the Close Button (X) on the Access
Application Window (95/97)
http://support.microsoft.com/?id=258049

ACC2000: How to Disable the Close Button (X) on the Access
Application Window
http://support.microsoft.com/?id=245746

ACC2002: How to Disable the Close Button (X) on the Access
Application Window and the Exit Command on the File Menu
http://support.microsoft.com/?id=300688

Alternatively, take a look here:

http://www.mvps.org/access/general/gen0005.htm

Hope that helps,
 
C

Claes D

Thanks all for your help guys.

I tried Jeffs method, and it worked great.
Super!!!

/Claes D

"Jeff Conrad" skrev:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top