Delete button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ykhamitkar
    New Member
    • May 2007
    • 64

    Delete button

    Hi there,

    I have ms access continuos form.

    I tried to put a delete which would delete the current record. but it doesnt work
    It doesnt give any error message either.

    Following is the code I used

    On Error GoTo Err_Command48_C lick


    DoCmd.DoMenuIte m acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuIte m acFormBar, acEditMenu, 6, , acMenuVer70

    Exit_Command48_ Click:
    Exit Sub

    Err_Command48_C lick:
    MsgBox Err.Description
    Resume Exit_Command48_ Click

    Please help,

    Yogesh
  • BradHodge
    Recognized Expert New Member
    • Apr 2007
    • 166

    #2
    Is this a subform that is set to continuous?

    I ran your code from a continuous form (no subforms) without any problem. If however you run it on a parent form that has child subforms, you don't get anything. In which case you could add Me.YourSubFormN ame.SetFocus before telling it to delete the record.

    Brad.

    Comment

    • hyperpau
      Recognized Expert New Member
      • Jun 2007
      • 184

      #3
      Originally posted by BradHodge
      Is this a subform that is set to continuous?

      I ran your code from a continuous form (no subforms) without any problem. If however you run it on a parent form that has child subforms, you don't get anything. In which case you could add Me.YourSubFormN ame.SetFocus before telling it to delete the record.

      Brad.
      I agree. In fact, on one of my db projects, I needed to program
      a Delete button, custom error messages, a BeforeDelConfir m and an AfterDelConfitm just to have it do what I want it to do.

      Comment

      Working...