ok this is the code i have so far...
Code:
Dim stDocName As String
Dim StrWhere As String
Dim stToName As String
Dim stCCName As String
Dim stSubject As String
Dim stMessage As String
stDocName = "rptInvoice"
StrWhere = [OrderID] = [Forms]![Add an Order and Details]![OrderID]
stToName = DLookup("Email", "customers", "Orders.OrderID = " & [OrderID])
stCCName = "ABCD@ABCD.com"
stSubject = "Quotation Test"
stMessage = "Attached is a self generated purchasing quotation. This is a test."
DoCmd.SendObject acSendReport, stDocName, acFormatPDF, stToName, stCCName, stSubject, stMessage
Two things are going wrong for me...
the email field always gets the first record emial addresss and my where condition is not working the pdf attached is getting every record.
Please help!