View Full Version : Loop


MEDolin
12-12-2001, 05:19 AM
I have an outer loop the runs 1200 times. After each year (12) loops I need to run additonal code reseting certain vaules. Example after 12, 24, 26, 48, 60, etc. Is there a may to determine the loop without ading each value.

PearlGI
12-12-2001, 05:28 AM
The following loop would work:

For x = 1 To 1200
IF x MOD 12 = 0 THEN
{Do Something Different}
EndIF
Next x

The MOD function returns the remainder of x divided by 12, therefore if x is divisible by 12 the remainder equals zero.

HTH http://www.access-programmers.co.uk/ubb/wink.gif