>I am trying to print a list report based on the contents of a two-dimensional array which
>is populated from calculations on fields from a table. The problem is, I am getting the
>message 'Subscript out of bounds' after the report is executed. The report is printing
>out correctly but I want to avoid this error message.
>In my report I have a bunch of fields in the Details section containing:
>
>current(nCounter,1)
>current(nCounter,2)
>and so on...
>
>As you can see I am using the Report Designer's nCounter variable because the report
>will not be printing a fixed number of records.
>Any ideas how I can avoid this error?
I've burned my fingers on using arrays in reports - when some dirty data come in. Since then, I'm calling an UDF for that, and it performs some range checking first, and it returns a "???" if the range is out, else it retrieves the proper array element. The only things to watch out for is some dimension checking (i.e. is alen(array)=alen(array,1) to see if its 1- or 2-dimensional), and not to forget to pass the array by reference.