Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42220

CR8.5 - Error in Formula on 2nd time opening report from VB6 app

$
0
0
It appears that ANY report which has a sub-report is throwing this error the 2nd time I run the report from my VB6 app. If I delete the sub-report(s) then it works, but I need some of these sub-reports so I really need to make it work. I have saved off and re-imported the sub-reports and converted the DB drivers and everything and still no luck. The reports work without issue from the IDE but my application throws the error above after more than 1 open of the report.

Here's some more info on the error...

Error # - 20515
Error in File C:\report.rpt:
Error in formula <Record_Selection>.
'{report.sample_ref_no} = 32623'
This field name is not known.

Here's an example of the code that is calling the report...

Code:

strConnect = "DSN=server;UID=username;PWD=password;DSQ=DBName"
strSelect = "{ANALYTE_MANIFEST_JOIN.RELEASE_RESULT} = true and {CHAIN_OF_CUSTODY.SAMPLE_REF_NO} = 32624"
strReportFile = "C:\program\reports\coc_final_results.rpt"

crwManReport.ReportFileName = strReportFile
If Len(strSelect) > 0 Then
crwManReport.ReplaceSelectionFormula strSelect
End If
With crwManReport
.Connect = strConnect
intSubCount = .GetNSubreports
For iCurRpt = 0 To intSubCount - 1
.SubreportToChange = .GetNthSubreportName(iCurRpt)
.Connect = strConnect
Next
If Not modBIF.blnRunBatch Then
.WindowState = crptMaximized
.WindowShowCloseBtn = True
.WindowShowPrintSetupBtn = True
.Action = 1
End If
End With


Viewing all articles
Browse latest Browse all 42220

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>