So many times I needed to do maintenance on the database then update the frontend but couldn’t because other users had it open. Well, I finally found a fix! Now I can give the users a warning before the database closes on them. Here’s how:
- Go to this site and download the file. (Scroll down and the link is right before the comments). https://www.databasejournal.com/features/msaccess/article.php/3548586/Auto-Logout-Users-for-DB-Maintenance.htm#
- Open your FRONTEND database and the database you just downloaded. Drag the table from the downloaded database over to your database. The table must be a local table, not on your backend.
- Go to your forms then drag the three forms from the downloaded database over to your database. You’re done with the downloaded database so you can close it.
- In your database, click in the Navigation pane, click the drop-down menu and choose “Macros”.
- Right-click the “autoexec” macro and choose “Design View”.
- Add a New Action – Click the down arrow and choose “OpenForm”. Next to form name, choose “frmDemo”. Next to Window Mode, choose “Hidden”.
- Add a New Action – Click the down arrow and choose “Open Form”. Next to form name, choose “frmLogoutTimer”. Next to Window Mode, choose “Hidden”. Save
When you are ready to save to the frontend after you’ve done maintenance,
- Open the Frontend database. Go to forms and open “frmDemo”.
- Check the box that says “Logout All Users”. Then open form “frmLogoutTimer” and click “Run”. It takes a few seconds before the popup will show up on the users interface, however after about 3 minutes, all users should be logged out automatically. Don’t forget to uncheck the box when you are finished.
By Rana Kory