RobNauticus
MIS
Hello I have a little problem getting a crystal report to launch from Access.
The error I get is marked with a ====>. One one computer I get "There was a Hardware Error" on another I get a dao.workspace error. I have tested and checked the code up until the point of the error and everything looks good and has all the right data from what I can see. I tried it on another computer (all WinXP Pro) and it worked! I am not sure what is the problem. I have a feeling that it is not the code and is a dll problem.
I have the code send the report to the viewer control on Forms!ReportViewer!Crviewer1
THANKS!!!!
Rob
The following code is a module just for crystal procedures.
The error I get is marked with a ====>. One one computer I get "There was a Hardware Error" on another I get a dao.workspace error. I have tested and checked the code up until the point of the error and everything looks good and has all the right data from what I can see. I tried it on another computer (all WinXP Pro) and it worked! I am not sure what is the problem. I have a feeling that it is not the code and is a dll problem.
I have the code send the report to the viewer control on Forms!ReportViewer!Crviewer1
THANKS!!!!
Rob
The following code is a module just for crystal procedures.
Code:
Option Compare Database
Public crxApplication As New CRAXDRT.Application
Public crxReport As CRAXDRT.Report
Public crxExportOptions As CRAXDRT.ExportOptions
Public crReportFile1 As String
Public crReportFile2 As String
Public crReportFile3 As String
Public crReportFile4 As String
Public crReportFile5 As String
Public crReportFile6 As String
Public crReportFile7 As String
Public crReportFile8 As String
Public crReportFile9 As String
Public crReportFile10 As String
Public crReportFile11 As String
Public Sub PreviewReport(ButtonNum As Integer)
On Error GoTo err_h
Dim rf1 As String
Select Case ButtonNum
Case 1
rf1 = crReportFile1
Case 2
rf1 = crReportFile2
Case 3
rf1 = crReportFile3
Case 4
rf1 = crReportFile4
Case 5
rf1 = crReportFile5
Case 6
rf1 = crReportFile6
Case 7
rf1 = crReportFile7
Case 8
rf1 = crReportFile8
Case 9
rf1 = crReportFile9
Case 10
rf1 = crReportFile10
Case 11
rf1 = crReportFile11
End Select
DoCmd.OpenForm "ReportViewer", acNormal
======>Set crxReport = crxApplication.OpenReport(rf1)
Forms!ReportViewer!Crviewer1.ReportSource = crxReport
crxReport.Database.Tables(1).Location = Application.CurrentProject.Path
Forms!ReportViewer!Crviewer1.ViewReport
Forms!ReportViewer!Crviewer1.Zoom (56)
While Forms!ReportViewer!Crviewer1.IsBusy
DoEvents
Wend
err_h:
MsgBox Str$(Err) & " " & Error$
Stop
Resume
End Sub