Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

¿Crystal Report Launching in Access - Please Help Diagnose?

Status
Not open for further replies.
Feb 25, 2004
79
US
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.
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
 
My guess is that it is a reference issue although those are not the errors you would expect. You would expect something like
"Can not find object or library"
"User defined object not allowed"

But if you have not yet done it, look at the computer that it runs on and check the references. Ensure that the other computers have the same references (to include versions), and that they appear in the same order.

For example we have some machines with
Microsoft Office 10.0 library
and some with 11.0.
due to different release times and it cause problems.
 
Hey Majp,

Thanks for the response, I am going to check them against each other. I am at the other computer right now and I just looked more closely at the ".Path" Property, it is only the folder path not the ".FullName" That fixed it on this machine.

Now to the next computer!;)



Thanks,
Rob

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top