How Do I create Individual report files (Again!)

Arendvan

Registered User.
Local time
Yesterday, 17:16
Joined
Jun 30, 2009
Messages
10
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
'
 
The code fragment you posted only tests that the essential variables are not null.
It certainly isn't generating the error.
 

Users who are viewing this thread

Back
Top Bottom