i would like for this to NOT pull the report of the org if it is null. there are some days that one of the orgs have nothing in them and it just has errors across the whole report. How can i make it so it only pulls the reports that are not null. here is my code i am using.
Private Sub cmdPrint3_Click()
Dim x As Integer, I As Integer, c As Integer
Dim strTable As String
Dim strReport As String
Dim db As Database, rc As Recordset
Set db = CurrentDb
Set rc = db.OpenRecordset("tblDates"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
c = Me.cboCopy.Value
strTable = "tblDates"
strReport = "rptCycleByGraph"
If IsNull(c) Then
c = 1
End If
Interaction.MsgBox "You are about to print " & c & " copies"
For I = 1 To 3
x = Choose(I, 550, 555, 556)
With rc
.Edit ' Enable editing.
.Fields("ClientOrg"
= x
.Update
End With
DoCmd.SelectObject acReport, strReport, True
DoCmd.PrintOut acPrintAll, , , , c
'DoCmd.OpenReport strReport, acViewNormal
'DoCmd.Close acReport, strReport
Next I
End Sub
Thank for your help in advance.
Smiley
Private Sub cmdPrint3_Click()
Dim x As Integer, I As Integer, c As Integer
Dim strTable As String
Dim strReport As String
Dim db As Database, rc As Recordset
Set db = CurrentDb
Set rc = db.OpenRecordset("tblDates"
c = Me.cboCopy.Value
strTable = "tblDates"
strReport = "rptCycleByGraph"
If IsNull(c) Then
c = 1
End If
Interaction.MsgBox "You are about to print " & c & " copies"
For I = 1 To 3
x = Choose(I, 550, 555, 556)
With rc
.Edit ' Enable editing.
.Fields("ClientOrg"
.Update
End With
DoCmd.SelectObject acReport, strReport, True
DoCmd.PrintOut acPrintAll, , , , c
'DoCmd.OpenReport strReport, acViewNormal
'DoCmd.Close acReport, strReport
Next I
End Sub
Thank for your help in advance.
Smiley