good morning,
i have VBA code to create an email and attach an excel file,
what i would like is code to add a report called REPORTMISSINGDATES to the body of the email,
this is the code i have so far, which works and adds everythng i wqant except the main body of the email
Expand|Select|Wrap|Line Numbers
- Private Sub Command31_Click()
- On Error GoTo Command31_Click_Err
- Dim Email As String
- Dim name As Variant
- Dim EMPloy As Variant
- Dim month As Variant
- month = MonthName([Forms]![STAFFATTENDANCEMenu]![StaffMonth])
- EMPloy = Forms!staffattendancezone!Staff
- name = DLookup("[STAFFNAME]", "[QRYSTAFFNAME]", "[ASA] = Forms!staffattendancezone!Staff")
- Email = (Forms!STAFFATTENDANCEAdjust!Email)
- DoCmd.SendObject acQuery, "STAFFATTENDANCEZONECheckEmployee", "ExcelWorkbook(*.xlsx)", [email], "", "", "" & "Attendance Errors", "THIS IS WHERE I WANT THE REPORT TO GO" _
- End Sub