i'm using vb6 and crystal reports 8.5. i have a string value that i need to pass to my rpt. here is the sample of my code:

Set CRReport = New CRAXDRT.Report
Set CrxApp = CreateObject("CrystalRunTime.Application")
Set CRReport = CrxApp.OpenReport(vstrReportFile)
CRReport.Database.SetDataSource vPassedADORS, 3, 1
CRViewer1.ReportSource = CRReport
CRReport.ParameterFields(0) = " Par1;" + vstrParameters + " ;true"
CRReport.PrintOut False, 1, True

when i run this code i get the error subscript out of range.

when i create another project that uses the crystal report component i use the following code:

cry1.ParameterFields(0) = " Par1;" + vstrParameters + " ;true"
cry1.printreport

it works fine.

can any one help?

Thank You,
Thomas