One way to do this would be to append a row into a table in the database that
would keep track of who has opened the database. That code would be triggered
when the startup form is opened. If there already was a name in the table,
then the application would let the user know who has the database open, and
then close.
The unload event of the startup form should remove the name of the user from
the table.
You may want to keep the date of when the user logged into the database in
that table as well; someone may leave the database open and go home without
closing the database. It gets a little sticky here. If the date is older than
a day, maybe delete the old log record and let the new person in.
A problem with the solution is that a user could open the database with the
shift key down. You should disable that from happening.
Method 2.
Another way to do this would be to write the name of the logged in user to a
file. Anybody else that opens the database first reads the file, if it
exists. The database then closes if the file exists. Then what you could do
is have the users not open the database directly, but run a vbscript file
that would check for the existence of the user log file first. If there were
none, then the script would make and write to the file, and open the
database. When the database closes, it would delete the file.
Hope this helped.