![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am trying to prevent end users from being able to use the SHIFT key to bypass the Autoexec and see the data tables. I used following code from Microsoft to create and set the "AllowBypassKey property to false, but the database seems to still bypass the Autoexec and shows the Navigation Pane and all menus. Any thoughts? Thanks! Option Compare Database Sub SetBypassProperty() Const DB_Boolean As Long = 1 ChangeProperty "AllowBypassKey ", DB_Boolean, False 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 Debug.Print strPropName & " " & 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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |