Hi,
Send object code works well to attach a pdf file to an email from a button click on a form.
The issue I'm having, is the attached pdf contains several reports, and not just the "current open form" report.
How can I modify the code below to only send the report that relates to the open form?
Thankyou
Code:
Private Sub EmailBtn_Click()
On Error GoTo ErrHandler
DoCmd.SendObject acSendReport, "HoseTestReport", acFormatPDF, Forms!frmHoseDetails!EmailAddress, , , _
" Hose Test Details " & TestSerial & " Attached ", "Please find your Hose Test Report attached."
Exit Sub
ErrHandler:
If Err = 2501 Then
' User canceled the message - ignore this
Else
' Report the error
MsgBox Err.Description, vbExclamation
End If
End Sub