T
trekgoes2malaysia
I am trying to sum up values in an array. Since I am using real
numbers (with decimals), I have declared the array 'as single' .
Unfortunately, whenever one of the items in my array is null, this
causes an error when running a For ...Next routine since ACCESS cannot
seem to deal with nulls in a variable declared as single.
I tried to get around this problem by declaring the array as a variant
but then that resulted in the for ...next routine giving me a null
value for the sum if the last iteration of the routine is Null (rather
than the sum).
How can I get around this?? Below is my code:
j = 20.
For i=1 to j
sumx(i)=sumx(i) + 1
next
numbers (with decimals), I have declared the array 'as single' .
Unfortunately, whenever one of the items in my array is null, this
causes an error when running a For ...Next routine since ACCESS cannot
seem to deal with nulls in a variable declared as single.
I tried to get around this problem by declaring the array as a variant
but then that resulted in the for ...next routine giving me a null
value for the sum if the last iteration of the routine is Null (rather
than the sum).
How can I get around this?? Below is my code:
j = 20.
For i=1 to j
sumx(i)=sumx(i) + 1
next