Hello,
I'm trying to add RequisitionID number to the attached pdf in sendObject code. is there a way to do this?
I'm trying to add RequisitionID number to the attached pdf in sendObject code. is there a way to do this?
Code:
Private Sub MailReport_Click()
On Error GoTo MailReport_Click_Err
Dim emailto As String
emailto = List5.ItemData(List5.ItemsSelected.Item(0))
If StrPtr(emailto) = 0 Or Len(emailto) = 0 Then
Cancel = True
Else
DoCmd.SendObject acReport, "ReportOrderDetailQuery", "PDFFormat(*.pdf)", emailto, "", "", "PO Requisition #" & Report_ReportOrderDetailQuery![RequisitionID], "Requestor: " & Report_ReportOrderDetailQuery![fk_RequestorID] & vbNewLine & "Request Date: " & Report_ReportOrderDetailQuery![RequestDate] & vbNewLine & "Status: " & Report_ReportOrderDetailQuery![Status] & vbNewLine & "Total: $" & Report_ReportOrderDetailQuery![Text625] & vbNewLine & vbNewLine & "Regards," & vbCrLf, True, ""
Beep
MsgBox "Your email was successfully sent!", vbOKOnly, ""
MailReport_Click_Exit:
Exit Sub
MailReport_Click_Err:
MsgBox "The operation was cancelled"
Resume MailReport_Click_Exit
End If
End Sub