P
PayeDoc
Hello All
I have the function below, which used to work fine, but now when I try to
run it I get runtime error 3061 and a message saying that there are "too few
parameters - expected 1". The code stops on the line
Set rstS = CurrentDb.OpenRecordset("select * from
[qry_client_organisation_for_email]")
Hope someone can help.
Many thanks
Leslie Isaacs
Public Function EmailIndivCircular()
Dim rstS As Recordset
Const strReport = "rpt missing wrong fees letter only"
Const strFilePrefix = "Z:\Client_Reports\TempPayslips\IndivCircular "
Dim strFileName As String
DoCmd.OpenForm "frm practices"
Set rstS = CurrentDb.OpenRecordset("select * from
[qry_client_organisation_for_email]")
With rstS
If .RecordCount Then
.MoveFirst
Do Until .EOF
mstrPracticeToEmail = ![prac name]
[Forms]![frm x main]![prac name] = rstS![prac name]
strFileName = strFilePrefix & mstrPracticeToEmail &
".pdf"
ConvertReportToPDF strReport, vbNullString, strFileName,
False
SendJmail !email, _
"", _
"(e-mail address removed)", _
"Account details", _
"Please see attached letter regarding your
account." & vbCrLf & vbCrLf & "Kind regards" & vbCrLf & "Leslie Isaacs" &
vbCrLf & "PayeDoc", _
strFileName
Kill strFileName
.MoveNext
Loop
End If
End With
ExitHere:
On Error Resume Next
rstS.Close
Set rstS = Nothing
End Function
I have the function below, which used to work fine, but now when I try to
run it I get runtime error 3061 and a message saying that there are "too few
parameters - expected 1". The code stops on the line
Set rstS = CurrentDb.OpenRecordset("select * from
[qry_client_organisation_for_email]")
Hope someone can help.
Many thanks
Leslie Isaacs
Public Function EmailIndivCircular()
Dim rstS As Recordset
Const strReport = "rpt missing wrong fees letter only"
Const strFilePrefix = "Z:\Client_Reports\TempPayslips\IndivCircular "
Dim strFileName As String
DoCmd.OpenForm "frm practices"
Set rstS = CurrentDb.OpenRecordset("select * from
[qry_client_organisation_for_email]")
With rstS
If .RecordCount Then
.MoveFirst
Do Until .EOF
mstrPracticeToEmail = ![prac name]
[Forms]![frm x main]![prac name] = rstS![prac name]
strFileName = strFilePrefix & mstrPracticeToEmail &
".pdf"
ConvertReportToPDF strReport, vbNullString, strFileName,
False
SendJmail !email, _
"", _
"(e-mail address removed)", _
"Account details", _
"Please see attached letter regarding your
account." & vbCrLf & vbCrLf & "Kind regards" & vbCrLf & "Leslie Isaacs" &
vbCrLf & "PayeDoc", _
strFileName
Kill strFileName
.MoveNext
Loop
End If
End With
ExitHere:
On Error Resume Next
rstS.Close
Set rstS = Nothing
End Function