Hmmmm.... This is a puzzle.

I have five columns on my screen, as follows (sorry, it's wrapping here):

storeID Units TotalStores AvgUnitsStore Retail ($000)
--------------------------------------------------------------------------------------------------------------------------------
txtSt(0) txtUnits(0) txtTotalStores(0) lblAvg(0) lblRetail(0)

txtSt(1) txtUnits(1) txtTotalStores(1) lblAvg(1) lblRetail(1)

txtSt(2) txtUnits(2) txtTotalStores(2) lblAvg(2) lblRetail(2)

Each column continues through an index of 7...
Note the indexes are set up the same for each element within the same storeID.

When the user opens this screen, the TotalStores column will contain a default values which can be changed... no problem. The Units column, however, will be empty until the user enters a number, which is where I could run into problems.

The AvgUnitsStore column fields lblAvg will be calculated like so:


For i = 0 to 7
lblAvg(i) =txtUnits(i) / txtTotalStores(i)
Next

When the calculation is performed, some of the txtUnits(i) fields will still be empty, which will cause an error unless I put additional instructions within the For...Next, telling it to skip the calculation for lblAvg(i) where txtUnits(i) equals null, and then to continue to the next (i).

The lblRetail( ) field will be calculated similarly in the For...Next, using a different formula.

Thanks for any and all suggestions in advance.


Tracey