Shift Holding (1 Viewer)

Vassago

Former Staff Turned AWF Retiree
Local time
Today, 14:44
Joined
Dec 26, 2002
Messages
4,751
Other than creating an MDE file, is there any other way to stop shift from overriding startup options in a database?
 

pdx_man

Just trying to help
Local time
Today, 11:44
Joined
Jan 23, 2001
Messages
1,347
Here is some code that I found that will do it. I don't remember where I got it. (probably here!) Create an autoexec macro with a RunCode command:

Code:
Function ap_DisableShift()
On Error GoTo errDisableShift

Dim db As Database
Dim prop As Property
Const conPropNotFound = 3270

    Set db = CurrentDb()

    db.Properties("AllowByPassKey") = False

    Exit Function

errDisableShift:
    If Err = conPropNotFound Then
        Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)
        db.Properties.Append prop
        Resume Next
    Else
        MsgBox "Function 'ap_DisableShift' did not complete successfully."
        Exit Function
    End If

End Function
 

Vassago

Former Staff Turned AWF Retiree
Local time
Today, 14:44
Joined
Dec 26, 2002
Messages
4,751
That worked beautifully, thanks a lot!

:D
 

Users who are viewing this thread

Top Bottom