I am working with an "inherited" access database to produce reporting for one of my firm's annual research projects. I have used this database and the particular module represented here without issue for 7 years, but this time it is giving me a Subscript Out of Range: Run-Time Error 9. When I debug, it leads me to the code noted below, with the highlighted text noted below.
Select Case X
Case Is = 1 'case where both NumInJob and BaseAvg were reported
IncCount = IncCount + SortedBaseSet("NumInJob") 'add to incumbent count
BaseIncCount = BaseIncCount + SortedBaseSet("NumInJob") 'add to incumbent count
WtdFactor = WtdFactor + (SortedBaseSet("BaseAvg") * SortedBaseSet("NumInJob"))
AvgIncFactor = AvgIncFactor + 1 'One person added to track simple average
AvgFactor = AvgFactor + SortedBaseSet("BaseAvg")
N = N + 1
DataTank(N) = SortedBaseSet("BaseAvg") ' read into array
Putting my curser over the N following DataTank gives me the number 10001
Earlier in the module, the DataTank is referenced in the following code:
Dim DataTank(1 To 10000) As Double, C As Integer, IncCount As Integer, BaseIncCount As Integer, WtdFactor As Double
This leads me to think there is a duplicate record in the DataTank, but I'm not sure how to find the "DataTank" among the tables and queries that the module draws on. It doesn't seem to be a common term in Access use, so I'm guessing it might just be a term the original programmer liked to use.
I am a non-technical, but have been using Access for a number of years. Can anyone suggest an approach to help me find the data (assume its in a table somewhere - there are many in this database) that is being referenced in this "Subscript Out of Range" error?
Many thanks for your help.