Ms access 在access visual basic中禁用Ctrl键和Alt键
如何禁用Access中的Ctrl键?为了不执行Ctrl+S等操作。。。 希望有人能在我的项目中帮助我 感谢…使用AutoKeys宏禁用Ctrl+S键Ms access 在access visual basic中禁用Ctrl键和Alt键,ms-access,vba,ms-access-2010,Ms Access,Vba,Ms Access 2010,如何禁用Access中的Ctrl键?为了不执行Ctrl+S等操作。。。 希望有人能在我的项目中帮助我 感谢…使用AutoKeys宏禁用Ctrl+S键 谢谢。。。但我认为这会很好 Option Compare Database Option Explicit Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) 'KeyCode 83 is "S" and acCtrlMask is for
谢谢。。。但我认为这会很好
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
为什么要这样做?您可以在MS Access中使用关键事件,但我认为您最好使用更新事件。例如,BeforeUpdate有一个cancel参数--
Private Sub Form\u BeforeUpdate(取消为整数)
这是Excel中的吗?我希望它能进入