Ashley has attended:
Access VBA course
For/Next Do/Loop - Step Functions
Within a for/next loop i know you can 'step' through the loop using the code
For x to y step z
...
next
will step through a count loop only displaying multiples of z (if counting units for instance)
Is it possible to set up a similar step function using a do x/loop routine? I cant get it to accept the 'Step z' at the end of the Do.... line
Many Thanks
RE: For/Next Do/Loop - Step Functions
Hi Ashley
Thanks for your question.
Step values only work with count based loops. Conditional based loops require numeric variables to be increased explicitly.
An example would be as follows
Sub test()
a = 1
b = 10
Do While a < b
a = a + 2
Loop
End Sub