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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top