M
MDW
I've got a database in Access 97 that records the items
shipped and received for a warehouse. Because of the
nature of the operation, I can't know any advance how many
items will be included on a shipment - it could be 1, it
could be 50. (I think it's a reasonable thing to assume
that we'll never break 100 items per shipment.)
To accomidate, I've got a dynamic string array that stores
the values in VB. I've got 5 unbound text boxes, and my
form reads their values, increases the size of the array,
and adds the value the newly created slot. On my system
(the development PC), it works like a charm. I could add
15 or 20 things, and the items are added OK.
However, on the PCs down in the warehouse, they tell me
they will often get "Subscript out of range" errors -
sometimes two or three times in a row. The actual line
that throws the error is this one:
ReDim Preserve myArr(UBound(myArr) + 1)
The only difference I can think of is that on their
system, there could be a 15 or 20 minute wait period
between the times that they add items. Whereas when I test
it, I add all the items at once and process the thing.
Is there some kind of "time out" or something where VBA
will "forget" what was in the array? Or does anyone else
have a suggestion for another method by which I can
dynmically save multiple items in VBA?
shipped and received for a warehouse. Because of the
nature of the operation, I can't know any advance how many
items will be included on a shipment - it could be 1, it
could be 50. (I think it's a reasonable thing to assume
that we'll never break 100 items per shipment.)
To accomidate, I've got a dynamic string array that stores
the values in VB. I've got 5 unbound text boxes, and my
form reads their values, increases the size of the array,
and adds the value the newly created slot. On my system
(the development PC), it works like a charm. I could add
15 or 20 things, and the items are added OK.
However, on the PCs down in the warehouse, they tell me
they will often get "Subscript out of range" errors -
sometimes two or three times in a row. The actual line
that throws the error is this one:
ReDim Preserve myArr(UBound(myArr) + 1)
The only difference I can think of is that on their
system, there could be a 15 or 20 minute wait period
between the times that they add items. Whereas when I test
it, I add all the items at once and process the thing.
Is there some kind of "time out" or something where VBA
will "forget" what was in the array? Or does anyone else
have a suggestion for another method by which I can
dynmically save multiple items in VBA?