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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report not running

Status
Not open for further replies.

MCHS2007

IS-IT--Management
Feb 19, 2007
3
US
I have recently taken over a database...and I am very new to this.

I am trying to run a report that is already built and it seems like the command that retrieves the information is not working properly.

the command that is not working:

strQuery = ba(1) & "'" & strProgram & "*'" & ba(3) & "'" & strProgram & "*'" & ba(5)

When I move my cursor over all of the commands it gives me a description of where the information is coming from...except for the ba(5): it says "subscript out of range"

Could this be my problem...or does anyone have any ideas???
 
Ba(3) is refering to the fourth row (asssuming numbering begins with 0) in an array named BA. The error occurs because the array has less than 4 rows.

You will need to go back to where the array is being declared (dim'd or Redim'd) and make sure it is being declared with the requisite rows. Or else look for the data in a different row of the array.

Cheers,
Bill
 
Is *ba* a ComboBox or ListBox control? Does it have 6 columns? The index reference for them is zero based so (0) is column 1.

HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
It seems to me that "ba" is an array. Arrays start with zero, unless Option Base specifies a different lower bound. It seems likely that there are 5 elements in your array:

0,1,2,3,4

Not:

1,2,3,4,5

Hence the error.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top