Microsoft Access

MS Access – Knock Users Out of Database

AutoLogoutSo 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:

  1. 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#
  2. 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.
  3. 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.
  4. In your database, click in the Navigation pane, click the drop-down menu and choose “Macros”.
  5. Right-click the “autoexec” macro and choose “Design View”.
  6. Add a New Action – Click the down arrow and choose “OpenForm”. Next to form name, choose “frmDemo”. Next to Window Mode, choose “Hidden”.
  7. 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,

  1. Open the Frontend database. Go to forms and open “frmDemo”.
  2. 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

One thought on “MS Access – Knock Users Out of Database

  1. Yes, don’t forget to uncheck the box when you are finished. Or you will become a victim of your own script. It will immediately close you out of the database after your open it! Luckily there is a solution – hold shift while opening the database as administrator and then go to the table and uncheck the auto logout box. PHEW!

    Liked by 1 person

Leave a comment