Report Won't Print

CCIDBMNG

Registered User.
Local time
Today, 12:04
Joined
Jan 25, 2002
Messages
154
I have a report that opens just fine but when we go to print the report it doesn't give me an error but it doesn't print. I need to print this report. It never used to do this but I just recently added code the to report footer to open another report. Someone please help.
 
Remark out your code and see if it works. If it does, it's your code. If there is a problem, post your code at the site.
 
If I take out the code it prints, right now I am opening a report in the report footer. If I use a subreport instead of just opening another report it prints fine. I guess it doesn't like me opening a report in the report footer. Here is my code...

gtotal = Text130
x = int(gtotal / 4998) + 1


If x > 1 Then
inv = 65
For a = 1 To x
rs.AddNew
rs![Date] = Text37
rs![Type] = "National"
rs![Invoice] = Text43 & Chr(inv)
inv = inv + 1
If a = x Then
rs![Total] = gtotal - (Int(gtotal / 4998) * 4998)
Else
rs![Total] = 4998
End If
rs.Update
Next
End If

DoCmd.OpenReport ("rptInvoice")
 
Print Button...

You can make a form and put the a button and put the following code for that button. change accordingly.

Private Sub Print_Click()
On Error GoTo Err_Print_Click

Dim stDocName As String

Query4Data

' change rptdatafieldreport to your report name
stDocName = "rptDatafieldreport"
DoCmd.OpenReport stDocName, acNormal

Exit_Print_Click:
Exit Sub

Err_Print_Click:
MsgBox Err.Description
Resume Exit_Print_Click

End Sub
 

Users who are viewing this thread

Back
Top Bottom