troubleshooting Question

How to trigger Form events?

Avatar of dpokerbear
dpokerbearFlag for Australia asked on
Microsoft Access
13 Comments1 Solution1004 ViewsLast Modified:
If I use the code below (button code) to delete a record in a subform data sheet, then the code I have in Form - On Delete Event doesn't get triggered. How can I make Form events trigger while using the code below?

Private Sub cmdSubDeleteRecord_Click()

On Error GoTo Err_MyProc

   Me.sub_frmSessionAttendance.Form.Recordset.Delete

Exit_MyProc:
        'Deassign all objects.
       
        Exit Sub

Err_MyProc:
        'Error handler here
        Select Case (Err.Number)
            Case 3021
                MsgBox "No record is selected."
            Case Else
               MsgBox (Err.Description)
        End Select
   
        Resume Exit_MyProc
End Sub
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros