在访问visual basic中禁用Ctrl键和Alt键

时间:2014-02-19 10:06:01

标签: ms-access access-vba ms-access-2010

如何在Access中禁用 Ctrl 键?为了不执行 Ctrl + S 等... 希望有人能在我的项目中帮助我。

感谢...

2 个答案:

答案 0 :(得分:1)

使用AutoKeys宏禁用键 Ctrl + S

enter image description here

答案 1 :(得分:0)

谢谢...但我认为会没事......

    Option Compare Database
    Option Explicit

    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

    'KeyCode 83 is "S" and acCtrlMask is for Ctrl
    'Disabling Ctrl+S
    If KeyCode = 83 And Shift = acCtrlMask Then

    'Disabling Ctrl Only
    'If Shift = acCtrlMask Then
    MsgBox "Ctrl + S is disabled", vbInformation, "Kamote"
    KeyCode = 0
    End If
    End Sub

    Private Sub Form_Load()
    KeyPreview = True
    End Sub