Hi Everyone,
Im a long time lurking reading and have always loved the forum.
I have been looking for awhile for some help which will save me the rest of my hair on my head- I simply cannot get this going properly as I am a NOOB to MS Access and have played with looping record set but seem to cause so many errors in the VBA code I don't even know where to begin to fix it.
I need to generate fractional costs for multiple items based upon their life expectancy. Once their life expectancy is reached, it's fractional value restarts and continues, until a predefined set year (a field in a form). The restarting assumes items are automatically renewed.
In the attached example picture, the end year is set to 2000. Fractions are based on life expectancy, for example: 1/5, 2/5, 3/5, 4/5, 5/5 - this repeats because the item is renewed. For example, two items are listed below.
I still am clueless on how to perform the looping operation on each record until a specified year. The basic idea is the following:
My logic is as follow:
IF the (CurrentYear)-(OriginalYearBuilt) MOD (Life Expectancy)=0
True: 1 (representing renewal of the item and the multiplier is set to 1)
False:
[(CurrentYear)-(OriginalYearBuilt) MOD (Life Expectancy) ] / Life Expectancy
This represents the relative multiplier fraction.
I am unable to perform this on each record, iterativly from the original year built to the selected end date defined in a form's field?
Please, can anyone help me out there?
Im a long time lurking reading and have always loved the forum.
I have been looking for awhile for some help which will save me the rest of my hair on my head- I simply cannot get this going properly as I am a NOOB to MS Access and have played with looping record set but seem to cause so many errors in the VBA code I don't even know where to begin to fix it.
I need to generate fractional costs for multiple items based upon their life expectancy. Once their life expectancy is reached, it's fractional value restarts and continues, until a predefined set year (a field in a form). The restarting assumes items are automatically renewed.
In the attached example picture, the end year is set to 2000. Fractions are based on life expectancy, for example: 1/5, 2/5, 3/5, 4/5, 5/5 - this repeats because the item is renewed. For example, two items are listed below.
I still am clueless on how to perform the looping operation on each record until a specified year. The basic idea is the following:
My logic is as follow:
IF the (CurrentYear)-(OriginalYearBuilt) MOD (Life Expectancy)=0
True: 1 (representing renewal of the item and the multiplier is set to 1)
False:
[(CurrentYear)-(OriginalYearBuilt) MOD (Life Expectancy) ] / Life Expectancy
This represents the relative multiplier fraction.
I am unable to perform this on each record, iterativly from the original year built to the selected end date defined in a form's field?
Please, can anyone help me out there?