Repeat Event

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I want to run code a certan number of times. How would I do this? It
would be based on a field where if the user puts 5 in the code runs 5
times, if the user puts 10 in, then the code runs 10 times,,,,etc.
Thanks
DS
 
User a For Next Loop:

Call RepeatingCode

Sub RepeatingCode
Dim lngCounter as Long

For lngCounter = 1 to Me.UsersInput
'Code to repeat goes here
Next lngCounter

End Sub
 
DS said:
I want to run code a certan number of times. How would I do this? It
would be based on a field where if the user puts 5 in the code runs 5
times, if the user puts 10 in, then the code runs 10 times,,,,etc.
Thanks

Is there an actual event -- in the object-programming sense -- involved?
Basically you'd use a loop, like this:

Dim I As Integer

For I = 1 To Nz([YourCountField], 0)

' ... here's where the code to be repeated goes ...

Next I
 
Dirk said:
I want to run code a certan number of times. How would I do this? It
would be based on a field where if the user puts 5 in the code runs 5
times, if the user puts 10 in, then the code runs 10 times,,,,etc.
Thanks


Is there an actual event -- in the object-programming sense -- involved?
Basically you'd use a loop, like this:

Dim I As Integer

For I = 1 To Nz([YourCountField], 0)

' ... here's where the code to be repeated goes ...

Next I
Yes, The code creates a new SalesID and Splits the dollar amount into
that amount. I'll give your suggestion a try.
Thanks
DS
 
Klatuu said:
User a For Next Loop:

Call RepeatingCode

Sub RepeatingCode
Dim lngCounter as Long

For lngCounter = 1 to Me.UsersInput
'Code to repeat goes here
Next lngCounter

End Sub

:
Thanks I'll give it a try!
DS
 
Dirk said:
I want to run code a certan number of times. How would I do this? It
would be based on a field where if the user puts 5 in the code runs 5
times, if the user puts 10 in, then the code runs 10 times,,,,etc.
Thanks


Is there an actual event -- in the object-programming sense -- involved?
Basically you'd use a loop, like this:

Dim I As Integer

For I = 1 To Nz([YourCountField], 0)

' ... here's where the code to be repeated goes ...

Next I
Worked Great! Thanks.
 
Klatuu said:
User a For Next Loop:

Call RepeatingCode

Sub RepeatingCode
Dim lngCounter as Long

For lngCounter = 1 to Me.UsersInput
'Code to repeat goes here
Next lngCounter

End Sub

:
Works Great Thanks
DS
 
Back
Top