Hi all,
I want to email a report using emaildatabaseobject in a macro but would like to auto fill the subject line with data from the report
I am using Outlook
i have below code, which i found on this site but not sure where to add this code
I still need to edit the code to my needs
I want to email a report using emaildatabaseobject in a macro but would like to auto fill the subject line with data from the report
I am using Outlook
i have below code, which i found on this site but not sure where to add this code
I still need to edit the code to my needs
Dim rst As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT * FROM WhateverTable"
Set rst = Currentdb.OpenRecordset(strSQL)
Do Until rst.EOF
WhateverYourEmailCodeIs.Subject = Format(rst!FieldNameHere, "0000") & rst!TheOtherFieldNameHere
WhateverYourEmailCodeIs.Send
rst.MoveNext
Loop
rst.Close
Set rst = Nothing