Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"File not found" error

Status
Not open for further replies.

topramen

Programmer
Jan 31, 2002
2
0
0
US
I'm using Crystal Reports 8 in VB6. I have designed a report using the designer tools within VB6 so I am not referenceing any outside .RPT file. That report works just fine. The problem occurs when I try to integrate a subreport into it. I set everything up as it should be (as far as I can tell) but when my program attempts to run the report, I get the error: "File not found".

What could be the problem? I'm stumped! I would appreciate any help you could give me or if you could tell me where to find good documentation on this sort of thing.

I thank you in advance.

P.S. Below is the code I'm using in the VB form that contains the Crystal Reports Viewer. Perhaps you may be able to spot some errors that I can't. - Thanks again...

'''''''''''''''''''''''''''''''''''''''''

Dim rptMainReport As New crptMain

Private Sub Form_Load()
Dim sQuery As String
sQuery = "SELECT TOP 20 * FROM Client_Master"

Screen.MousePointer = vbHourglass

Dim rs As New ADODB.Recordset
rs.Open sQuery, g_oConn

rptMainReport.Database.SetDataSource rs
rptMainReport.ReadRecords
rptMainReport.OpenSubreport "srProviders"

crvMain.ReportSource = rptMainReport
crvMain.ViewReport

'Clean up
Set rptMainReport = Nothing
rs.Close
Set rs = Nothing

Screen.MousePointer = vbDefault
End Sub

Private Sub Form_Resize()
crvMain.Top = 0
crvMain.Left = 0
crvMain.Height = ScaleHeight
crvMain.Width = ScaleWidth
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top