T
Tim
I am trying to output multiple one page reports using a recordsource as the
parameter from a push button. The code I am using is listed below, but when I
press the button it does nothing.
Any help would be greatly appreciated.
Thank you
Private Sub AM_Click()
Dim dbf As DAO.Database
Dim rst As DAO.Recordset
Dim strFileName As String
Dim strPathName As String
strPathName = DLookup("[ReportPath]", "ReportPath_SIA")
Set dbf = CurrentDb
Set rst = dbf.OpenRecordset("fltr_Associates_Scorecard_AEAM")
With rst
If .RecordCount = 0 Then
msgbox "No employees to process"
Else
.MoveLast
.MoveFirst
Do While Not .EOF
strFileName = strPathName & ![rptName] & "_" * ![Name] & ".snp"
DoCmd.OutputTo acOutputReport, acFormatSNP, strFileName
.MoveNext
Loop
.Close
End If
End With
Set rst = Nothing
End Sub
parameter from a push button. The code I am using is listed below, but when I
press the button it does nothing.
Any help would be greatly appreciated.
Thank you
Private Sub AM_Click()
Dim dbf As DAO.Database
Dim rst As DAO.Recordset
Dim strFileName As String
Dim strPathName As String
strPathName = DLookup("[ReportPath]", "ReportPath_SIA")
Set dbf = CurrentDb
Set rst = dbf.OpenRecordset("fltr_Associates_Scorecard_AEAM")
With rst
If .RecordCount = 0 Then
msgbox "No employees to process"
Else
.MoveLast
.MoveFirst
Do While Not .EOF
strFileName = strPathName & ![rptName] & "_" * ![Name] & ".snp"
DoCmd.OutputTo acOutputReport, acFormatSNP, strFileName
.MoveNext
Loop
.Close
End If
End With
Set rst = Nothing
End Sub