Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

subscript out of range.



Hello everyone.
 
I have a problem here. Hope some of you can help me out.
Sorry for cross posting, because I find that there's more response from this NG, but yet I want to post it to crystal NG also.
 
I'm trying to pass 2 parameters from VB6 to crystal report.
The follow is my code:
 
I guess the problem should be with my Array. But I'm not too sure as to how to edit it as I actually copied the code from some websites...
Can someone pls explain to me.
 
+===================================================+
Set crptApp = New CRPEAuto.Application
Set crptRpt = crptApp.OpenReport(App.Path & "\MyReport.rpt")
Set rptDB = crptRpt.Database
Set rptTbls = rptDB.Tables
Set rptTbl = rptTbls.Item(1)
rptTbl.SetLogOnInfo "dsn=MyDSN"
 
Set crptParaFDs = crptRpt.ParameterFields
Set crptParaFD = crptParaFDs.Item(1) <== Error here.
crptParaFD.SetCurrentValue CStr(dtCommFrmDate.Value)
 
Set crptParaFD = crptParaFDs.Item(2)
crptParaFD.SetCurrentValue CStr(dtCommToDate.Value)
 
crptRpt.Preview
 
Set crptParaFD = Nothing
Set crptParaFDs = Nothing
Set crptRpt = Nothing
Set crptApp = Nothing


<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.