My report just stopped showing up in it's window here is my code.
private sub cmdreport_click()
Report.DataFiles(0) = App.Path & "\report.mdb"
Report.PrintReport
end sub()
No errors reported either.
Printable View
My report just stopped showing up in it's window here is my code.
private sub cmdreport_click()
Report.DataFiles(0) = App.Path & "\report.mdb"
Report.PrintReport
end sub()
No errors reported either.
Crystal does return errors but they're not always visible. Try this;
Do you get an error now..?Code:
Dim Reply As Integer
Report.DataFiles(0) = App.Path & "\report.mdb"
Reply=Report.PrintReport
If Reply<>0 Then
Msgbox "Crystal Error " & Report.LastErrorNumber & " (" & Report.LastErrorString & ")"
End If
Hi chongo 2002,
I have this in my code to show my Crystal Reports.
Private Sub mnuReportsfrmPreviewShift_Click()
With CrystalReport9
.Destination = crptToWindow
.DataFiles(0) = "H:\Software Development Projects\Maintenance database\Maintenance Data.mdb"
.ReportFileName = "H:\Software Development Projects\Maintenance database\Summary By Shift.rpt"
.Action = 1
End With
End Sub
I also put the crystal report control on the main form, so that it would not trouble with showing the report. You can get that control from Project, Components, then select the crystal report control and apply.
Good luck!
jeffro
I get an unable to open database error now or a report not found.
Let me see your code again.
jeffro
If i leave out the .datafiles line it works fine.