B
Bob
Hello All,
I've been stuck on this one for far too long. I need help.
I wrote an Access application that calls Crystal Reports for all the various reports. When I run the report (any one of them) everything works as
expected. When I try to run a second time (whether it's the same report or not) it comes up with an error:
Run-time error '-2147483638 (8000000a)'
You entered an expression that has an invalid reference to the property |.
I can't track the error down. It appears to have something to do with the window border color, but not sure. Am I not initializing something the
second time around or did I not close and release objects properly, etc????
My code is shown below:
Would really like to put this project to bed,
Bob.
Access 2003, Crystal Reports v10
================================================
Option Compare Database
Public crxApplication As New CRAXDDRT.Application
Public crxReport As CRAXDDRT.Report
Public crxExportOptions As CRAXDDRT.ExportOptions
Dim crxParamDefs As CRAXDDRT.ParameterFieldDefinitions
Dim crxParamDef As CRAXDDRT.ParameterFieldDefinition
Public TheReportPath As String
Public TheReportFile As String
Private Sub Form_Load()
TheReportPath = "C:\Test\"
End Sub
Private Sub btnRpt016_Click()
TheReportFile = TheReportPath & "R105016.rpt"
ReportOnMir ("")
End Sub
Private Sub ReportOnMir(rpt As String)
Me!CRViewer1.Visible = True
Me!CRViewer1.top = 700
Me!CRViewer1.Left = 50
Me!CRViewer1.Height = 7500
Me!CRViewer1.Width = 12900
Me!CRViewer1.DisplayGroupTree = False
Dim crxApplication As New CRAXDDRT.Application
Set crxReport = crxApplication.OpenReport(TheReportFile)
Set crxParamDefs = crxReport.ParameterFields
crxReport.RecordSelectionFormula = "{MirMaster.MIRCtl} = " & CStr(Me![MIRCtl])
For Each crxParamDef In crxParamDefs
With crxParamDef
Select Case .ParameterFieldName
Case "MIRNumberParam"
.SetCurrentValue (Me![MIRCtl])
Case "MIRDateParam"
.SetCurrentValue CDate(Me![MIRDateInit])
End Select
End With
Next
Me!CRViewer1.ReportSource = crxReport 'Set ReportSource to the report object
Me!CRViewer1.ViewReport 'View the report
Set crxReport = Nothing
End Sub
I've been stuck on this one for far too long. I need help.
I wrote an Access application that calls Crystal Reports for all the various reports. When I run the report (any one of them) everything works as
expected. When I try to run a second time (whether it's the same report or not) it comes up with an error:
Run-time error '-2147483638 (8000000a)'
You entered an expression that has an invalid reference to the property |.
I can't track the error down. It appears to have something to do with the window border color, but not sure. Am I not initializing something the
second time around or did I not close and release objects properly, etc????
My code is shown below:
Would really like to put this project to bed,
Bob.
Access 2003, Crystal Reports v10
================================================
Option Compare Database
Public crxApplication As New CRAXDDRT.Application
Public crxReport As CRAXDDRT.Report
Public crxExportOptions As CRAXDDRT.ExportOptions
Dim crxParamDefs As CRAXDDRT.ParameterFieldDefinitions
Dim crxParamDef As CRAXDDRT.ParameterFieldDefinition
Public TheReportPath As String
Public TheReportFile As String
Private Sub Form_Load()
TheReportPath = "C:\Test\"
End Sub
Private Sub btnRpt016_Click()
TheReportFile = TheReportPath & "R105016.rpt"
ReportOnMir ("")
End Sub
Private Sub ReportOnMir(rpt As String)
Me!CRViewer1.Visible = True
Me!CRViewer1.top = 700
Me!CRViewer1.Left = 50
Me!CRViewer1.Height = 7500
Me!CRViewer1.Width = 12900
Me!CRViewer1.DisplayGroupTree = False
Dim crxApplication As New CRAXDDRT.Application
Set crxReport = crxApplication.OpenReport(TheReportFile)
Set crxParamDefs = crxReport.ParameterFields
crxReport.RecordSelectionFormula = "{MirMaster.MIRCtl} = " & CStr(Me![MIRCtl])
For Each crxParamDef In crxParamDefs
With crxParamDef
Select Case .ParameterFieldName
Case "MIRNumberParam"
.SetCurrentValue (Me![MIRCtl])
Case "MIRDateParam"
.SetCurrentValue CDate(Me![MIRDateInit])
End Select
End With
Next
Me!CRViewer1.ReportSource = crxReport 'Set ReportSource to the report object
Me!CRViewer1.ViewReport 'View the report
Set crxReport = Nothing
End Sub