Disable 'Backdoor" entry to Front End

Q

QSS

I have set up the standard FE/BE in my Database which works fine. However I
want to disable the SHITF key enty option to the FE so users cannot get
access to the forms, queries, reports etc . How do I do this but keep the
option for my use as admininistrator ?
 
A

Allen Browne

Create an MDE as the front end to give users. Set the AllowBypassKey
property of the MDE, from your original database:

Function StartupProps(bSet As Boolean)
Dim db As DAO.Database
Dim strDB As String
Dim strPrp As String

strDb = "C:\My Path\MyFrontEnd.mde"
Set db = OpenDatabase(strDB)

Call ChangeProperty(db, "AllowSpecialKeys", dbBoolean, bSet)
Call ChangeProperty(db, "AllowBypassKey", dbBoolean, bSet)

db.Close
Set db = Nothing
End Function

Function ChangeProperty(dbs As Database, strPropName As String, _
varPropType As Variant, varPropValue As Variant) As Integer
Dim prp As Property
Const conPropNotFoundError = 3270

On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Debug.Print strPropName & " is " & varPropValue

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
 
Top