Getting Run Time Error '340' Control array element '1' Doesn't exist

Altaf Patni
Altaf Patni used Ask the Experts™
on
i am trying to run a report from visual basic but Getting
Run Time Error '340' Control array element '1' Doesn't exist

i am using following code
on Debug its highlighted on Crystalreport1.SelectionFormula line
CrystalReport1.ReportFileName = App.Path & "\AccGM.rpt"
CrystalReport1.Connect = "DSN=******;UID=********;PWD=***********;DSQ=TPL"
CrystalReport1.DiscardSavedData = True
[b]CrystalReport1.SelectionFormula = "{BDtl.LtNo} = " & Text1(0) & " And {BDtl.GName} = '" & Text1(1).Text & "' And {BDtl.Check}= '1'"
[/b]

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Text() must be an array defined in your program.
So you have to look at your code that is used to set up the array.
Altaf PatniSoftware Developer

Author

Commented:
<< Text() must be an array defined in your program. >>
Yes i am using an array for text boxes.. like...Text1(0) and Text1(1) and text1(2)..etc..

so do i need to change from text1(0) to just text1.?
Altaf PatniSoftware Developer

Author

Commented:
There is no text1(1) in my form..
i have replaced with original text box and it is working.

Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial