Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Releasing an access program

Status
Not open for further replies.

Fabioedl

Programmer
Feb 18, 2004
6
US
What is the best way of releasing an access program to the end user? I there a password protected way to prevent the end user of going into design mode but also let the programmer support the database (adding/changing forms or reports)?

Thanks all,

Fabioedl
 
Fabioedl,
What I do is establish a password/login form that Loads on Database Startup. If the Programmer successfully logs in then a hidden button appears, and clicking this button will open a new Admin form. Two buttons on this form allow and disallow the ByPass key (Shift key).
Code:
Private Sub BT_Allow_Click()
    ChangeProperty "AllowBypassKey", 1, True
    DoCmd.Close
End Sub
Code:
Private Sub BT_DisAllow_Click()
    ChangeProperty "AllowBypassKey", 1, False
    DoCmd.Close
End Sub
Code:
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
    Dim dbs As Database, prp As Variant
    Const conPropNotFoundError = 3270

    Set dbs = CurrentDb
    On Error GoTo Change_Err
    dbs.Properties(strPropName) = varPropValue
    ChangeProperty = True

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
        Resume Change_Bye
    End If
End Function
Of course you should also disable the Databse Window and the Special Access keys on startup.
I also have an autoexec Macro that sets all the necessary startup Properties just in case.
Code:
Function SetProperty()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "Login"
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, True
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
ChangeProperty "AllowFullMenus", DB_Boolean, False
ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
ChangeProperty "AllowSpecialKeys", DB_Boolean, False
ChangeProperty "AllowBypassKey", DB_Boolean, False

' Turn the MouseWheel Off (call another function)
MouseWheelOFF

End Function
Hope that helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top