Minty
AWF VIP
- Local time
- Today, 07:56
- Joined
- Jul 26, 2013
- Messages
- 10,603
I've recently converted a 2003 mdb to 2010 accdb which has been relatively painless. However I'm struggling to make the crystal active x viewer work.
The code crashes out at the yellow line with an Run Time error "Invalid TLV record"
A fair bit of gogling and a long look on here hasn't helped, .
Any suggestions, I'm sure it's a reference / method problem, but the code works fine on the old mdb.
The code crashes out at the yellow line with an Run Time error "Invalid TLV record"
A fair bit of gogling and a long look on here hasn't helped, .
Code:
'Crystal objects
Dim CRapp As CRAXDRT.Application
Dim CRrep As CRAXDRT.Report
'On Error GoTo ErrorHandler
'Screen.MousePointer = 11 'Hourglass
'open local table amd retrieve the repart details
Set db = CurrentDb()
sSQL = "SELECT rptPath, rptReportName, rptSelectionFormula FROM tblRptViewer"
Set rs = db.OpenRecordset(sSQL, dbOpenDynaset)
rs.MoveFirst
sRptPath = rs.Fields("rptPath")
sRptName = rs.Fields("rptReportName")
sSlctnFrmla = rs.Fields("rptSelectionFormula")
rs.Close
Set rs = Nothing
Set db = Nothing
'set cr viewer sizes
CRwidth = 22
CRheight = 12
Me.txtCRsize_W = CRwidth
Me.txtCRsize_H = CRheight
'Run the report
Set CRapp = New CRAXDRT.Application
Set CRrep = New CRAXDRT.Report
Debug.Print (sRptPath & "\" & sRptName)
[COLOR="Yellow"] Set CRrep = CRapp.OpenReport(sRptPath & "\" & sRptName)[/COLOR]
CR_View.ReportSource = CRrep
CR_View.ViewReport