View Full Version : Report Won't Print


CCIDBMNG
07-02-2003, 11:28 AM
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.

jaydwest
07-02-2003, 12:07 PM
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.

CCIDBMNG
07-02-2003, 02:07 PM
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")

doran_doran
07-03-2003, 07:15 AM
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