I have a couple reports in my application and they are all the same programatically. However one report crashes VB Studio 6.0.
Code:Dim Report As New CRSalesMonthly Private Sub Form_Load() On Error GoTo MyErrorTrap: Me.WindowState = vbMaximized ' Add the datasource to the report Set Report = Nothing Set Report = New CRSalesMonthly 'sets the database password enabling the report to connect Report.Database.Tables(1).SetSessionInfo "", Chr(10) & HSODBpswrd 'Sets the location for the first table in the report to the Access database. If the report has 'more than one table the same location will propagate through all of the tables. 'You can set a new location for each table individually based on it's index in the Tables collection. Report.Database.Tables(1).Location = HSODBPathAndName Screen.MousePointer = vbHourglass CRViewer1.ReportSource = Report CRViewer1.ViewReport Screen.MousePointer = vbDefault Exit Sub MyErrorTrap: MsgBox Err.Description, vbOKOnly End Sub
It crashes at CRViewer1.ViewReport
stepping through the code shows me that the password is correct as well as the DB location.
Strange....
Any ideas?


Reply With Quote