Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Disable delete key? (Access 2002)

    Is there a way to disable the delete key?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  2. #2
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,877
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Disable delete key? (Access 2002)

    Nice summary!

  3. #3
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Disable delete key? (Access 2002)

    Thanks Hans!
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Disable delete key? (Access 2002)

    Where do you want to disable the Delete key?

    Throughout the database?

    Create a new macro.
    Display the Macro Name column.
    Enter {DELETE} in the Macro Name column.
    Save the macro as AutoKeys (this name is mandatory).

    AutoKeys will be run automatically.

    In a specific form?

    Open the form in design view.
    Activate the Event tab of the Properties window.
    Set the Key Preview property to Yes.
    Create an On Key Down event procedure for the form:

    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyDelete Then
    KeyCode = 0
    End If
    End Sub

    In a specific control?

    Open the form in design view.
    Select the control.
    Activate the Event tab of the Properties window.
    Create an On Key Down event procedure for the control:

    Private Sub ControlName_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyDelete Then
    KeyCode = 0
    End If
    End Sub

    Replace ControlName with the name of the control.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •