Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

looping help

Status
Not open for further replies.

compcad

Programmer
Mar 22, 2002
52
US
i have a need for some help on a project i am working on for a client i have finally got everything in the project completed except for one thing and i am un sure about how to go about get it done.

is what i have done was to create a loop that when it accesss information from the database it will printout that many raffle tickets that i have designed and the design of the raffle ticket is inbedded into the for...next loop and also an if...then loop. this works fine i don't want to change this.

is where the problem lies is i need to find a way to take the loops from above and find a way to create a start and finish to the raffle tickets such as:

from: 1 to: 3
or
from: 1 to: 1
or
from: 6 to: 7
or
from: 510 to: 550
or
from: 201 to: 202
or
anything up to 4000 tickets
and
any combination

thank you
stephen mentzer
compcad@aol.com
 
One way would be to create two variables,

Code:
Dim l_strStart as string
Dim l_strEnd as string

You will need some method to feed the variables, textboxes for example. Then just place the variables into the loop.

Code:
For Int(l_strStart) to Int(l_strEnd)
   ...
next

The Int() function ensures that the values are converted to whole number integers.

Take Care,

zemp

"Show me someone with both feet on the ground and I will show you someone who can't put their pants on."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top