Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009

    Unanswered: delete button grayed out ms access 2007

    I just migrated to ms access 2007 from ms access 2003. And I have a problem in deleting records.

    I also created a new ribbon in the new ms access 2007. I would like to know what is the code use so that I could delete the records. Here is what I got in my basRibbonCallbacks

    Sub OnActionButton(control As IRibbonControl)
    Select Case control.Id
    Case "btnOpenFormular"
    DoCmd.OpenForm "FormName"
    Case "btnCloseFrmEingabe"
    DoCmd.Close acReport
    Case "btnDelete"
    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
    End Select
    End Sub

    is this correct? I tried this and its still not working.


  2. #2
    Join Date
    Oct 2009
    to delete a record while not involving a form one would use a Delete Query

    to get the syntax for the vba involving a form do this; open the form - add a command button to it - - the wizard for the button definition will launch and you want to define its action to delete a record when making the button; now go the vb property of that button's OnClick event and you will have the syntax....copy that to can delete the command button and then use the syntax at whatever event you wish....

Posting Permissions

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