T
tellier
I have set a button up on a form so the user can print out reports for
distrubution. Depending on the branch it will print different reports out.
Some time a report will have no information on it and I want it to not print
but then continue on to the next reprt.
I have tried adding the "No Data" event to the report but then if one report
at the begining has no data the rest of the reports don't print either.
Here is my code -- Could you make a suggestion on how to do this?
Thanks
Tonia
Private Sub Print_Branch_Const_Packets_Click()
On Error GoTo Err_Print_Branch_Const_Packets_Click
Rem CONSTRUCTION REPORTS
Dim num As Integer
num = 0
While (num < [Number of Reports Wanted])
Dim stDocName As String
Rem Division Reports
stDocName = "Graphs DIV"
DoCmd.OpenReport stDocName, acNormal
stDocName = "RPT Division - Construction - YTD 875000"
DoCmd.OpenReport stDocName, acNormal
Rem Branch Reports
If [City] = "Des Moines" Then
stDocName = "Graphs D"
DoCmd.OpenReport stDocName, acNormal
stDocName = "RPT Branch - Construction - Month Detail 875100 D"
DoCmd.OpenReport stDocName, acNormal
Else
End If
If [City] = "Kansas City" Then
stDocName = "Graphs K"
DoCmd.OpenReport stDocName, acNormal
stDocName = "RPT Branch - Construction - YTD 875100 K"
DoCmd.OpenReport stDocName, acNormal
stDocName = "RPT Branch - Construction - Month Summary 875100 K"
DoCmd.OpenReport stDocName, acNormal
stDocName = "RPT Branch - Construction - Month Detail 875100 K"
DoCmd.OpenReport stDocName, acNormal
Else
End If
Let num = num + 1
Wend
distrubution. Depending on the branch it will print different reports out.
Some time a report will have no information on it and I want it to not print
but then continue on to the next reprt.
I have tried adding the "No Data" event to the report but then if one report
at the begining has no data the rest of the reports don't print either.
Here is my code -- Could you make a suggestion on how to do this?
Thanks
Tonia
Private Sub Print_Branch_Const_Packets_Click()
On Error GoTo Err_Print_Branch_Const_Packets_Click
Rem CONSTRUCTION REPORTS
Dim num As Integer
num = 0
While (num < [Number of Reports Wanted])
Dim stDocName As String
Rem Division Reports
stDocName = "Graphs DIV"
DoCmd.OpenReport stDocName, acNormal
stDocName = "RPT Division - Construction - YTD 875000"
DoCmd.OpenReport stDocName, acNormal
Rem Branch Reports
If [City] = "Des Moines" Then
stDocName = "Graphs D"
DoCmd.OpenReport stDocName, acNormal
stDocName = "RPT Branch - Construction - Month Detail 875100 D"
DoCmd.OpenReport stDocName, acNormal
Else
End If
If [City] = "Kansas City" Then
stDocName = "Graphs K"
DoCmd.OpenReport stDocName, acNormal
stDocName = "RPT Branch - Construction - YTD 875100 K"
DoCmd.OpenReport stDocName, acNormal
stDocName = "RPT Branch - Construction - Month Summary 875100 K"
DoCmd.OpenReport stDocName, acNormal
stDocName = "RPT Branch - Construction - Month Detail 875100 K"
DoCmd.OpenReport stDocName, acNormal
Else
End If
Let num = num + 1
Wend