kevinh2320
Board Regular
- Joined
- May 13, 2016
- Messages
- 61
I have the code below on a button "on_click" event which works but, once the email is sent and the form comes back on screen I'm returned to the first record in the table. I want it to return to the record that I just emailed. I can't seem to figure out how to to that.
VBA Code:
Private Sub email_current_record_Click()
On Error GoTo EmailHandler
Dim f As Form
Set f = Forms![CallLogEntryForm]
f.Filter = "ID=" & f!ID
f.FilterOn = True
DoCmd.SendObject acSendForm, f.Name, acFormatPDF, , , , "Customer Call Notification", "See attached", True, "F:\CallLog\templates\CallLogEntryFormTemplate.pdf"
f.FilterOn = False
Set f = Nothing
Exit Sub
EmailHandler:
MsgBox "You must enter or load a record in the form."
End Sub
Last edited by a moderator: