| Home | Previous Lesson: Displaying a Background Logo Next Lesson: Customizing Toolbars |
Sometimes users may leave their desk without logging out. If the application contains confidential information, there is a possibility that the data could be seen by someone who shouldn't. You could rely on the Windows screen saver, but it is best to handle this from within the application.
Do it by disconnecting from the server and minimizing the application if it is idle for more than five minutes. In a multi-user environment, it is better to disconnect from the server whenever it is not needed for an extended period of time.
Add the following line to the open event of the application:
Idle( 300 ) // Write this after Open( w_login )
This calls the idle event after 300 seconds or 5 minutes of inactivity. In the idle event for the application, write the following script:
// Object: Application // Event: Idle w_mdi_frame.WindowState = Minimized!
Test to see if the code works, by running the application and logging onto the database successfully and leaving it alone for five minutes.
| Home | Previous Lesson: Displaying a Background Logo Next Lesson: Customizing Toolbars |