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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add range of numbers

Status
Not open for further replies.

essmessm

Technical User
Jul 18, 2005
7
0
0
US
I have a group of ticket books, 25 per book. The first number is 1-25 and the 26-50 and so on. Is there a way to input the first number and have the table populate with the rest so when the tickets are turned in they can be paired with the person they were distributed too?

thanks

Steve
 
You could run a little code. For example:

Code:
For i=0 to 24
  strSQL="INSERT INTO SomeTable (TicketID) " _ 
  & "VALUES ( " & Me.txtStartNumber + i & " )"
  CurrentDB.Execute strSQL, dbFailOnerror
Next

Where Me.txtStartNumber comes from the form.

 
Since you apparently know the number of books, modify Remou's code to just loop through the entire set of values.




MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top