How to disable CTRL-S, but not CTRL-C/CTRL-V

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • julietbrown
    New Member
    • Jan 2010
    • 99

    How to disable CTRL-S, but not CTRL-C/CTRL-V

    For complicated reasons, I am disabling Ctrl-S on a form, so that users have to use the Save button. I have the following code, which works fine:

    Code:
    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
        Select Case True
        Case (Shift = acCtrlMask)
            Beep
            KeyCode = 0
        Case ((Shift = 0) And (KeyCode = vbKeyCancel Or KeyCode = vbKeyReturn Or KeyCode = vbKeyEscape))
            Beep
            KeyCode = 0
        End Select
    End Sub
    But this disables Ctrl-anything!! I would like users to still be able to cut and paste data in fields.

    Is there any way of catching the NEXT key after CTRL has been pressed down? I had thought the 'KeyCode' might be the next key, but it isn't! It is "17" which is the code for CTRL itself.

    (Long time since I've been here! Hope you are all still there?!!)
Working...