Re: How Do I create Individual report Files - Again
It is definitely possible to do. You basically need to run the report multiple times filtering each time.
Check out this:
Sending Emails To A Group, One Person At A Time
Hope it helps...
Hi:
I'm still having problems - I have put in the variables to the code you sent me and created the "tblgroupEmails" table but it keeps coming back with "Can't find the name of report I have specified".
I have listed the bit of code below (with some comments beside them) - can you check it over.
Thanks
Public Function SendReportToGroup(NameOfReport As String, _
FieldToGroupOn As String, _
EmailAddrField As String, _
GroupEmailName As String, _
EmailSubject As String, _
EmailFrom As String, _
EmailAddTo As String, _
EmailAddToField As String, _
EmailCC As String, _
EmailCCField As String, _
NameOfAttachment As String, _
DisplayBeforeSending As Boolean)
NameOfReport = "LetterRAE-Sec-Email"
(This is the Report Name)
FieldToGroupOn = "Ltype"
(Fieldname within record source for Report i.e. Query)
EmailAddrField = "Secmail"
(Fieldname within record source for Report i.e. Query)
GroupEmailName = 1
(I've only put one record in there at the moment so assume this is the "record Number")
EmailSubject = "Installation Representation Letter"
EmailFrom = " "
EmailAddTo = " "
EmailAddToField = " "
EmailCC = " "
EmailCCField = " "
NameOfAttachment = "Installation Representation Letter"
DisplayBeforeSending = True
'
On Error GoTo ErrSR
'
'Check to make sure all required parameters exist
If Nz(Len(NameOfReport), 0) = 0 Or Nz(Len(FieldToGroupOn), 0) = 0 Or _
Nz(Len(EmailAddrField), 0) = 0 Or Nz(Len(GroupEmailName), 0) = 0 Or _
Nz(Len(NameOfAttachment), 0) = 0 Then
MsgBox "You must enter all required parameters", vbOKOnly, "Incomplete Data..."
Exit Function
End If
'