Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » For/Next Do/Loop - Step Functions
For/Next Do/Loop - Step Functions
Resolved · Low Priority · Version 2003
For/Next Do/Loop - Step Functions
Within a for/next loop i know you can 'step' through the loop using the codeFor 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
For upcoming training course dates see: Pricing & availability
RE: For/Next Do/Loop - Step Functions
Hi AshleyThanks 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
|
|
» Forum post: VBA Access |



Course updates

