Hi Bob,
I'm sure there are lots of ways to do this, but here is the method I use.
1. Copy and paste all the code to a new standard module.
2. Compile the code and save the module as modCheckMultipleInstances.
3. Create a new macro.
4. In the Action column select RunCode from the drop down list.
5. A new box in the bottom left corner will appear asking for a function name.
6. Enter this in the Function name box: =winCheckMultipleInstances(False)
(Include the equal sign)
Now I selected False which meant there is no prompt to the user.
You can experiment with True to see what that does.
7. Now save the macro with a name called Autoexec.
With this name, this particular macro will fire any time this database is opened, unless of course
they hold down the shift key. (That can be disabled as well) If you have already created an Autoexec
macro just add this RunCode option at the bottom of any existing elements.
8. Make sure you set an application title under Tools | Startup | Application Title
9. Now save everything and close the database
10. Open the database, minimize, and then try and open another instance.
You should see some screen flickering, but only one instance in the Task Bar should show.
Hope that helps,