jamescullis
Registered User.
- Local time
- Today, 21:05
- Joined
- Jun 2, 2014
- Messages
- 38
hi All, newbie needing some help please?
I found the vba to generate multiple pdf's from a single report which is working well (see below).
The script below generates about 15 pdf files and stores them in the specified directory
I'd like to be able to now email these to the individual users (SCNAME) but cannot work out where to start, i've tried a lot of things from the research on emailing, just not working.
All the information I need is in one table which includes the users email address field (SCemail).
I've also created an update query which generates a unique file name into the field (SCInstallDate) (currently not using this field data)
Can you please advise how to modify the below code to make this happen, or should I be creating another process to look for the email address and file name
thanks in advance
I found the vba to generate multiple pdf's from a single report which is working well (see below).
The script below generates about 15 pdf files and stores them in the specified directory
I'd like to be able to now email these to the individual users (SCNAME) but cannot work out where to start, i've tried a lot of things from the research on emailing, just not working.
All the information I need is in one table which includes the users email address field (SCemail).
I've also created an update query which generates a unique file name into the field (SCInstallDate) (currently not using this field data)
Can you please advise how to modify the below code to make this happen, or should I be creating another process to look for the email address and file name
Code:
Private Sub cmdSC2PDF_Click()
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("SELECT DISTINCT [SCNAME] FROM [Schedule];", dbOpenSnapshot)
Do While Not rst.EOF
strRptFilter = "[SCName] = " & Chr(34) & rst![SCNAME] & Chr(34)
DoCmd.OutputTo acOutputReport, "fullschedulereport", acFormatPDF, "\\Server001\CompanyData\SC\temp" & "\" & rst![SCNAME] & "-" & Format(Date, "dd-mm-yyyy") & ".pdf"
DoEvents
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
End Sub
thanks in advance