Quitting Access via right clicking on Task bar icon

Phonik

Registered User.
Local time
Today, 04:00
Joined
Sep 22, 2006
Messages
111
Hi all,

I have built a database for my company but the only problem I am having at the moment is that I have built a login form that records the user ID's of users that are currently in the database that I can view from a different database (Admin manager). Users are able to click a button from a main menu that returns them to the login screen where the only other button to the login one is one that is called shutdown. This simply quits the database. When a user logs off in the correct manner, it runs a delet query that removes their login credentials from the logged in users table in the admin manager. I am encountering situations where users are not doing this process correctly and are simply right clicking on the incon of the database at the bottom of the screen where all other running application icons are and selecting close. This quits the database without removing the login information. I would like to know what code I could use to disable this close function so that it still appears on the menu when they right click but it will not allow them to do so and could even display a popup advising them to log out in the correct manner. Is anyone able to assist with this at all please? I would be very very grateful as this is the only problem I have with an otherwise great build. Even if I have to say so myself. Ha ha.
Thanks folks.

Kindest regards,

Gareth (Phonik):)
 
Use the UnloadEvent of a hidden form to direct users back to the correct from
 
Hi,

Thanks for your reply but I am not sure what you mean??

Sorry...

Gareth
 
Hi Phonik

What Rich is saying... You make a form, which opens upon the startup of your database, but this form opens Hidden... Thus the users dont know it is there.

This form you can use the "On Unload" event to Cancel the closing of the database.
offcourse you need to make sure your "proper" closing button takes care of "taking out" this code, otherwize it will never close....

Greets
 
You're all a bunch of superstars!!! Thank you very much indeed.

Regards

Phonik
 
What would be the best way of bypassing this when the user actually wants to quit in the correct manner?
 
From memory...

Forms("Formname").OnUnload = ""

that would disable the catch I think... But I am (allmost) sure if you search the forum for hidden forms or some sort of search you will find samples
 
Hi again. Sorry to be a pain. I have set the hidden form up to display a message saying that the user has attempted to exit incorrectly but when the user clicks ok to acknowledge the message, the database closes anyway. Any suggestions on how I get around this? Is it simply a case of selecting the correct message box type?

Thanks again
 
If you used the correct options there should be a variable Cancel comming into (and out of) that event.

You have to add: Cancel = true
To stop the closing of the database...
 
You should change your handle to God!
Thank you buddy...you've made someone day today!
 
Thanks for the complement I guess, but I am no where near god... Just someone who knows a little more than you do....
 

Users who are viewing this thread

Back
Top Bottom