Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create an add & delete trigger in subform 1

Status
Not open for further replies.

Aximboy

Technical User
Aug 3, 2003
63
US
Hello!

Here's what I have...
I have a form with all the client's info (address, telephone, etc) and a subform which contains contract number, approval date, termination date, etc in a continuous form view.

I want Access to automatically send an email whenever a user adds or deletes a record in the subform.

How do I create a trigger for any addition or deletion of record in a subform?  And how do I integrate that with the Docmd. SendObject?

Please help and thank you in advance.
 
you need these in the subform
Code:
Private Sub Form_AfterDelConfirm(Status As Integer)
  If Status = acDeleteOK Then
    'your code here
  End If
End Sub

Private Sub Form_AfterInsert()
  'your code here
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top