How to start a function on windows close command [X]

Pusher

BEOGRAD Put
Local time
Today, 20:09
Joined
May 25, 2011
Messages
230
Hi all,
I want to start a LogMeOff function on any kind of exit - by clicking exit button I did but when I click on the x of the window I don’t know how to start that function.

Thanks a lot :)
 
You need to have a hidden form that is always open and then you can call your LogMeOff function when this form unloads ie on the hidden form's Form_Unload event. This event will fire when you try to close the database using the X close button (assuming you haven't manually already closed the hidden form)
David
 
You need to have a hidden form that is always open and then you can call your LogMeOff function when this form unloads ie on the hidden form's Form_Unload event. This event will fire when you try to close the database using the X close button (assuming you haven't manually already closed the hidden form)
David

What he said. :D (that's the way I do it)
 
I have a module with a logmein and logmeoff function that gives users permissions when they login
 
Thanks - i already have a hidden login form for getting a username :)
 
Can you explain in a sentence each what logmein and logmeoff functions do when you log in and log out. Or how you use it.
 
I imported the whole thing so I can’t explain it in detail. I just know that the function logmein and out writes a user name time of login and time of logout in a specific table so I can know when and who logged in and logged out
 
Well, that's the problem - copying code without understanding what it does.

The LogMeOut function sounds like something that should be run when the db is closed, not just when any form's or report's [X] button is clicked.
 

Users who are viewing this thread

Back
Top Bottom