access-vba 启用班次功能代码
示例
Function EnableShift()
'This function enables the SHIFT key at startup. This action causes
'the Autoexec macro and the Startup properties to be bypassed
'if the user holds down the SHIFT key when the user opens the database.
On Error GoTo errEnableShift
Dim db As DAO.Database
Dim prop As DAO.Property
Const conPropNotFound = 3270
Set db = CurrentDb()
'This next line of code disables the SHIFT key on startup.
db.Properties("AllowByPassKey") = True
'function successful
Debug.Print"Enabled Shift Key - Successful"
GoTo ExitHere
errEnableShift:
'The first part of this error routine creates the "AllowByPassKey
'property if it does not exist.
If Err = conPropNotFound Then
Set prop = db.CreateProperty("AllowByPassKey", _
dbBoolean, True)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function 'ap_DisableShift' did not complete successfully."
GoTo ExitHere
End If
ExitHere:
Set prop = Nothing
Set db = Nothing
Exit Function
End Function
热门推荐
10 送女士祝福语长辈简短
11 男朋友祝福语简短新年
12 怀念青春祝福语简短
13 别人过大寿祝福语简短
14 祝贺开业文案祝福语简短
15 祝福语签名简短大全女生
16 发小结婚简短祝福语
17 老爸生日暴富祝福语简短
18 同事有趣祝福语大全简短