2014-02-19 65 views
0

如何禁用Ctrl在我的Access中鍵?爲了不執行Ctrl + S等... 希望有人能幫助我在我的項目。禁用Ctrl鍵和Alt鍵訪問visual basic

感謝...

+0

爲什麼你要它做什麼? – 4dmonster

+0

您可以使用MS Access中的按鍵事件,但我認爲使用更新事件會更好。例如,BeforeUpdate有一個取消參數 - 「Private Sub Form_BeforeUpdate(Cancel As Integer)」 – Fionnuala

回答

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 
相關問題