murray83
Games Collector
- Local time
- Today, 16:45
- Joined
- Mar 31, 2017
- Messages
- 736
im sure this has been asked before, i have done a search here but cant find anything like it
just need a pointer in what im doing wrong, as using teh following code
im having issues with the .To section
it keeps telling me, as you can see in the attached that the report name 'Qry_FailureReport' is wrong but its not
just need a pointer in what im doing wrong, as using teh following code
Code:
'email script
Public Sub CreateEmailWithOutlook()
'bits for the attachment
Dim myPath As String
Dim strReportName As String
todayDate = Format(Date, "DDMMYY")
myPath = "G:\GENERAL\MTM\km\database workings\PCC Compliance DB\FailureReport\"
strReportName = "Failure Report.pdf"
' Create a new email object
Set olApp = CreateObject("Outlook.Application")
Set olMailItem = olApp.createitem(olMailItem)
' Add the To/Subject/Body to the message and display the message
With olMailItem
.To = DLookup("[email]", "[tblSupplierDetails]", "SupplierNumber = Reports![Qry_FailureReport]![SupplierCode]")
im having issues with the .To section
it keeps telling me, as you can see in the attached that the report name 'Qry_FailureReport' is wrong but its not