One way of doing this is to create a form that remains hidden from the user. In the forms ontimer event, you could have the mde check a table or other value to see if it's supposed to close or not. If it is, simply exit the application (after proper warning of course).
Could you please a explain in a bit detail as I,m bit blank at this.
I understand the vb will look like
If tblcheck!check=1 then close application.
but how do I make sure that people don't loose the current data or update or currupt data.
And how do I manage this in MDE enviornment with 5 different Front End using at same time and leave it open for the person who executed the command!.
That's where your specific logic needs to come into play. When I implement this type of method, I have a table (usually named tblControl) that has one row containing application-wide variables I want to track. Examples are version, release date and Active, which is a yes/no field I can use to check and see if a front end should close or not.
To begin, create a form, set it's visible property to false. Now in an autoexec macro or the tools -> startup -> display form, define your new form to run automatically when the front end opens. Now you have a form that's present but the user doesn't see. Every form has a timer object that you can use to trigger events a specified intervals, use it. In the ontimer event, check your control table to see if a job is pending. If it is, apply your unique business logic.
It may flow something like this:
Is the Active bit set to false?
Is the current user an admin?
Prompt user to see if they are the one initiating a shutdown, if so, let them remain in the database
Prompt user to save all changes and exit the database.
You could apply additional logic to force shutdown if the user fails to comply
No: Continue normally
One of the guys on there is Neil Squires (under other developers link) has a function already done called ForceUserOut which basically soes what Teddy told you, It does have some documentation (not a whole lot, but enough [in the VBcode)
also when you add this, you add it to the front end (on your PC) then you'll need to copy it to the other machines(Portable drive are handy for this) but there is another person on that same site that has a Front End copy batch job type setup where when a person opens the front end it vhecks to see if all the forms / reports / etc. have changed. If they have it shuts the database down, copies from a master location (a copy of the FE that no one uses EXCEPT for the designer for designing purposes only) and then restarts the database. This is a little more involved but if you know what your doing it will speed up future updates as you make changes