Results 1 to 5 of 5
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Can't Delete Record (Access 2000)

    I have a command button with the following code in a form, but when I cliick on the button it doesn't delete the record. Any suggestions?

    Private Sub cmdDeleteRecord_Click()
    On Error GoTo Err_cmdDeleteRecord_Click


    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

    Exit_cmdDeleteRecord_Click:
    Exit Sub

    Err_cmdDeleteRecord_Click:
    MsgBox Err.Description
    Resume Exit_cmdDeleteRecord_Click

    End Sub

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

    Re: Can't Delete Record (Access 2000)

    Try replacing the antiquated Access 95 code

    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

    generated by the Wizard with

    RunCommand acCmdDeleteRecord

    If it doesn't work, you should get an error message. Please report that message in a reply.

  3. #3
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Can't Delete Record (Access 2000)

    Hi Hans,

    Here's the error message I get:

    The command or action 'Delete Record' isn't available now.

    Wouldn't it be nice if it would tell you WHY is isn't available?

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

    Re: Can't Delete Record (Access 2000)

    Without seeing the database, it's hard to say why. Can you delete a record manually, i.e. by clicking 'Delete Record' on the toolbar, or by selecting Edit | Delete Record?

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Can't Delete Record (Access 2000)

    If you're stepping through the code, you might get that error message because the focus is in the VBE. More information please.
    Charlotte

Posting Permissions

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