Blocking users from "opening exclusively"?

  • Thread starter Thread starter Bob Allen
  • Start date Start date
B

Bob Allen

How can I keep someone who is a regular user of the
database from opening up "exclusively", even if they
have "open exclusively" checked in their options.?

Thanks.

Bob
 
If they are opening the database exclusively, this code sets Access to
opening the database as shared, and then throws them out of the database.

Function TestOpenStatus()
Dim X As Variant

X = Application.GetOption("Default Open Mode for Databases")

If X = 1 Then
MsgBox "Please open this application in shared mode.", vbOKOnly,
"Error"
Application.SetOption "Default Open Mode for Databases", 0
Application.Quit
End If

End Function

You can put the function in the OnOpen Event of every form, if necessary.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top