Simple loop question

  • Thread starter Thread starter Silvio
  • Start date Start date
S

Silvio

Hello, I have a control that has a number in it (e.g. 5) I need to repeat a
task for the of time in my control. I guess it should be something like

Dim MyCounter as long

MyCounter = me.counter

Do while myCounter = 0

....do something

mycounter = mycounter -1
loop

Thak you,
Silvio
 
Silvio said:
Hello, I have a control that has a number in it (e.g. 5) I need to repeat a
task for the of time in my control. I guess it should be something like

Dim MyCounter as long

MyCounter = me.counter

Do while myCounter = 0

...do something

mycounter = mycounter -1
loop

A little simpler to use:

Dim MyCounter as long
For MyCounter = 1 To me.counter
...do something
Next MyCounter
 
Tnank you Marshall and B., that works great!

Marshall Barton said:
A little simpler to use:

Dim MyCounter as long
For MyCounter = 1 To me.counter
...do something
Next MyCounter
 
Back
Top