I have a form where, whenever a new record is created, I want a report to be emailed out.
I have some code (almost
) which will email the report, but which Event should I attach the code to?
The form opens in data entry mode.
I know the 'easy' option would be to put a button on the form which a user could click once they'd fill in all the details to send out the email - but I don't want them to do that because I don't want to give the the chance of NOT sending the email, iyswim?
I've tried putting the code on the AfterInsert of the form, but it isn't triggering when I want it to.. it only seems to be firing when the form is closed. I need the record to be 'complete' before it tries to send, so it should run when the user Saves the record (there's a cmdSave button), or closes the form down (there's a cmdClose button) but I don't want it to try and send it more than once... so I can't attach it to both!
So... to which event should I attach the code?
Help, please!
TIA...
I have some code (almost

The form opens in data entry mode.
I know the 'easy' option would be to put a button on the form which a user could click once they'd fill in all the details to send out the email - but I don't want them to do that because I don't want to give the the chance of NOT sending the email, iyswim?
I've tried putting the code on the AfterInsert of the form, but it isn't triggering when I want it to.. it only seems to be firing when the form is closed. I need the record to be 'complete' before it tries to send, so it should run when the user Saves the record (there's a cmdSave button), or closes the form down (there's a cmdClose button) but I don't want it to try and send it more than once... so I can't attach it to both!
So... to which event should I attach the code?
Help, please!
TIA...