S
Stephen sjw_ost
I have a stand alone database that is not split and will not be split because
only 1 person should be in the DB at any given time. Currently, multiple
users can open the DB but I want to stop this from happening so that when,
lets say, I have the DB open and someone else tries to open it, I want them
to get a Msgbox popup that says something like
"This database is already open by "user login here". Please try again later
or contact "user login here"
When they click on OK, the DB window closes.
I have tried to use this code;
If Dir(CurrentProject.Path & "TextMsgs.ldb") <> "" _
Then
MsgBox "This database is in use by " & fOSUserName()
DoCmd.Quit
End If
but it does not work.
How can I prevent a DB from being opened if it is already open?
Thanks for any help.
only 1 person should be in the DB at any given time. Currently, multiple
users can open the DB but I want to stop this from happening so that when,
lets say, I have the DB open and someone else tries to open it, I want them
to get a Msgbox popup that says something like
"This database is already open by "user login here". Please try again later
or contact "user login here"
When they click on OK, the DB window closes.
I have tried to use this code;
If Dir(CurrentProject.Path & "TextMsgs.ldb") <> "" _
Then
MsgBox "This database is in use by " & fOSUserName()
DoCmd.Quit
End If
but it does not work.
How can I prevent a DB from being opened if it is already open?
Thanks for any help.