Sub SetStartupProperties()
If MASTERUSER Then
ChangeProperty "StartupShowDBWindow", dbBoolean, False 'hide the dbwindow
ChangeProperty "AllowBreakIntoCode", dbBoolean, True 'show code after error
ChangeProperty "AllowSpecialKeys", dbBoolean, True 'special keys
ChangeProperty "AllowBypassKey", dbBoolean, True 'bypass key
ChangeProperty "StartupShowStatusBar", dbBoolean, True 'status bar
ChangeProperty "AllowFullMenus", dbBoolean, True 'fullmenus
ChangeProperty "AllowShortCutMenus", dbBoolean, True 'fullmenus
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
Else
ChangeProperty "StartupShowDBWindow", dbBoolean, False 'hide the dbwindow
ChangeProperty "AllowBreakIntoCode", dbBoolean, False 'show code after error
ChangeProperty "AllowSpecialKeys", dbBoolean, False 'special keys
ChangeProperty "AllowBypassKey", dbBoolean, False 'bypass key
ChangeProperty "StartupShowStatusBar", dbBoolean, True 'status bar
ChangeProperty "AllowFullMenus", dbBoolean, False 'full menus
ChangeProperty "AllowShortCutMenus", dbBoolean, True 'fullmenus
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
End If
End Sub
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbss As Database, prp As Property
Const conPropNotFoundError = 3270
Set dbss = CurrentDb
On Error GoTo Change_Err
dbss.Properties(strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If err = conPropNotFoundError Then ' Property not found.
Set prp = dbss.CreateProperty(strPropName, varPropType, varPropValue)
dbss.Properties.append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function