Controlling User Access (1 Viewer)

ForcedToUseIt

Registered User.
Local time
Today, 05:38
Joined
Jul 25, 2004
Messages
34
Hi
I want to make my database more robust and user friendly by restricting the access my users have to various resources in my database. E.g. I do not want the users to be able to see the database window, no matter what. Also I would like to remove most of the options in the Microsoft Access toolbars so that the user cannot go to Tools>Startup, or Tools>Database Utilities and soforth.

I have been looking around and Im not finding any information about this.
If you have any tips, ideas for me on how to accomplish this, I would really like to hear them

Thanks...
 

ForcedToUseIt

Registered User.
Local time
Today, 05:38
Joined
Jul 25, 2004
Messages
34
Yeah I figured it out. Tools > Startup and also Tools > Customize to remove everything you want.
And if you have locked everything and want to bypass it then when you open the database, hold down the shift-key.

All pretty simple...
 

delboy2

Registered User.
Local time
Today, 06:38
Joined
Oct 10, 2003
Messages
12
Hi here is some code that will prevent you from being able to use the shift key

If you are going to use this please make sure that you have a hidden button somewhere to unlock it again.

Code:
Sub SetBypassProperty()
'locks the database and does not allow shift key 
Const DB_Boolean As Long = 1
    ChangeProperty "AllowBypassKey", DB_Boolean, False
    MsgBox "False"
End Sub
'Unlocks Database and allows use of shift key
Sub UnSetBypass()
Const DB_Boolean As Long = 1
    ChangeProperty "AllowBypassKey", DB_Boolean, True
    MsgBox "True"
End Sub
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
    Dim dbs As Object, prp As Variant
    Const conPropNotFoundError = 3270

    Set dbs = CurrentDb
    On Error GoTo Change_Err
    dbs.Properties(strPropName) = varPropValue
    ChangeProperty = True
    MsgBox "Goodbye"
    
Change_Bye:
    Exit Function

Change_Err:
    If Err = conPropNotFoundError Then    ' Property not found.
        Set prp = dbs.CreateProperty(strPropName, _
            varPropType, varPropValue)
        dbs.Properties.Append prp
        Resume Next
    Else
        ' Unknown error.
        ChangeProperty = False
        MsgBox "Come back soon!", vbCritical, "DB says"
    
        Resume Change_Bye
    End If
End Function
 
Last edited by a moderator:

Users who are viewing this thread

Top Bottom