I've searched everywhere and can't find an answer, so...either I'm just braindead today, or don't know as much as I thought I did (probably this one).
VB6 SP6, Access 2000.
In the general section, I set Option Base 1 and dim a multi-dim array, LineItems()As Variant. In a Sub, I ReDim it to (12,11) and assign values to it from an .mdb (as I've done a hundred times). Then in another Sub I assign the array data, via a For/Next loop, to some text boxes for display.
That's where the Err 9 occurs. On the first pass thru the loop, index 1, data from the first array position goes into txtBox(1) just fine. The next item in the loop does not....and the index gets changed to 13, causing the Err 9. Note, the first iteration thru the loop never finishes...the index is changed while in progress.
There are 11 text boxes involved in the For/Next loop, but the error only occurs on certain ones. This leads me to beleive the cause of the error isn't in the array, but somewhere else (???).
I've debug.printed the array elements with a For/Next loop right before the assignment loop starts and everything's fine. Once the assignment loop starts, something is causing the loop index to change to 13, but there was valid data in all the array cells!?!?!?
Anybody have an idea??
Of all the things I've lost, I miss my mind the most!
Sideman
VB6 SP6, Access 2000.
In the general section, I set Option Base 1 and dim a multi-dim array, LineItems()As Variant. In a Sub, I ReDim it to (12,11) and assign values to it from an .mdb (as I've done a hundred times). Then in another Sub I assign the array data, via a For/Next loop, to some text boxes for display.
That's where the Err 9 occurs. On the first pass thru the loop, index 1, data from the first array position goes into txtBox(1) just fine. The next item in the loop does not....and the index gets changed to 13, causing the Err 9. Note, the first iteration thru the loop never finishes...the index is changed while in progress.
There are 11 text boxes involved in the For/Next loop, but the error only occurs on certain ones. This leads me to beleive the cause of the error isn't in the array, but somewhere else (???).
I've debug.printed the array elements with a For/Next loop right before the assignment loop starts and everything's fine. Once the assignment loop starts, something is causing the loop index to change to 13, but there was valid data in all the array cells!?!?!?
Anybody have an idea??
Of all the things I've lost, I miss my mind the most!
Sideman