Solved

Error 20534 when running Crystal Reports from a VB 4.0 program

Posted on 1997-10-30
1
220 Views
Last Modified: 2006-11-17
I am developing in MS VB 4.0 under MS DOS 6.22 & MS Windows 3.1.1.My application calls 5 Crystal Reports which run over an MS Access database with no problem. These reports do not have any selection criteria - they provide summary information over the whole of the tables they refer to. However, I have two other reports which do have selection criteria, set within the VB code. The application runs OK on the development PC, but when I use the VB Setup Wizard to produce a set of installation disks and install the application on a user's PC, running these two reports gives the above error.

Please find attached the VB code which calls the CRs.

**********************************************************
Public Sub ReportHandler(report As Integer)
**********************************************************
Dim dummy As String

    Select Case report
        Case 1
            frmMDI_Insurance.CrystalReport1.ReportFileName = ".\opnclms.rpt"
        Case 2
            frmMDI_Insurance.CrystalReport1.ReportFileName = ".\sixweek.rpt"
        Case 3
             frmMDI_Insurance.CrystalReport1.ReportFileName = ".\depttype.rpt"
        Case 4
            frmMDI_Insurance.CrystalReport1.ReportFileName = ".\reserved.rpt"
        Case 5
            frmMDI_Insurance.CrystalReport1.ReportFileName = ".\settle.rpt"
        Case 6  {one case which gives the error}
            frmMDI_Insurance.CrystalReport1.ReportFileName = ".\Crawlet.rpt"
            dummy = Chr(39) + grsClaimDetails("RBC_REF") + Chr(39)
            frmMDI_Insurance.CrystalReport1.SelectionFormula = "{qryMailMerge.RBC_REF}=" + dummy
        Case 7 {the second case which gives the error}
            frmMDI_Insurance.CrystalReport1.ReportFileName = ".\Claimlet.rpt"
           ' Call LogFile("After setting the reportname to Claimlet")
            dummy = Chr(39) + grsClaimDetails("RBC_REF") + Chr(39)
          '  Call LogFile("After building Dummy")
            frmMDI_Insurance.CrystalReport1.SelectionFormula = "{qryMailMerge.RBC_REF}=" + dummy
           ' Call LogFile("After setting the report selection formula")
    End Select
   
    frmMDI_Insurance.CrystalReport1.Destination = 0
 '   Call LogFile("After setting the report destination")
    frmMDI_Insurance.CrystalReport1.Action = 1
{the following line is not executed -> the error occurs on the Action of the report}
 '   Call LogFile("After setting the report Action")
   
End Sub

Any ideas ? Anything I can check/am (not) doing ?

Regards,

Simon Hall, Redditch Borough Council, Worcestershire, UK.
0
Comment
Question by:gog
1 Comment
 

Accepted Solution

by:
thomaskramer earned 200 total points
ID: 1439232
I think you have to re-set the DataFiles property of the crystal report control in your code, because it is stored in the report. When opening the report from vb, crystal report searches the database in the old directory. So write something like this:

CrystalReport1.DataFiles(0) = "c:\new\first.mdb"


0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Best way to parse out a json string in VB6? 10 172
Excel - Save a copy of work book 13 85
Run code from text file in vb 1 65
Advice in Xamarin 21 79
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question