98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum 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
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
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Change caseTo change case from upper or lower case, highlight the text area, hold down the Shift key and pres F3 |