VBA – Preventing the User Login Activity window from opening Example


From Microsoft Business Solutions – Great Plains v8.00 onwards the system has included a User Login Activity window which can be used by a user to remove their own login record after it has been left stranded by an abnormal termination of the application (read “crash”).


Some system administrators would prefer for this function to be disabled so they can monitor the number of times users are stranded and then remove them via the normal Tools >> Setup >> System >> User Activity method.  


NOTE: If you just remove the record from the ACTIVITY table using SQL, this will not cleanup other batch and transaction activity records for the user. 


This very simple VBA example uses the Window_BeforeModalDialog and Window_AfterModalDialog to automatically say “No” to the original dialog and then display a new message to display why the login failed.


The code for this customisation is also included (but commented out) in the VBA – Preventing Users from logging into multiple companies Example.


Example code for v8.0, v9.0 & v10.0 is attached at the bottom of the article.


Please see the “Installation Instructions.txt” file in each version’s archive for more information.

Prevent User Login Activity from Opening.zip

Comments (2)

  1. Microsoft Dynamics GP uses concurrent licensing which provides for a maximum number of users logged into

  2. Santosh Surti says:

    This is very good work to prevent users from log in into more than one company