Hi,
I was hoping someone could help me out here with some code. I need to
take a starting number and an ending number and produce a list of all
the numbers in between.
Ex:
Start_Num End_Num
2345611000 2345611005
5856378700 5855378703
7162251601 7162251601
I would like these to append to another table. For example once the
above are broken out, the following would append to a current table.
2345611000
2345611001
2345611002
2345611003
2345611004
2345611005
5856378700
5856378701
5856378702
5856378703
7162251601
Thanks in advance.
Allen Browne - 30 Nov 2006 04:30 GMT
See the MakeData() function at the end of this article:
http://allenbrowne.com/ser-39.html
You could change the first line:
Function MakeData()
to:
Function MakeData(Start_Num As Long, End_Num As Long)
and the line:
For lng = 1 to conMaxRecords
to
For lng = Start_Num to End_Num
Change the table name, and call the function to add the records.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Hi,
>
[quoted text clipped - 24 lines]
>
> Thanks in advance.
Marshall Barton - 30 Nov 2006 17:01 GMT
>I was hoping someone could help me out here with some code. I need to
>take a starting number and an ending number and produce a list of all
[quoted text clipped - 20 lines]
>5856378703
>7162251601
If you aready have Allen's tblCount and the start/end values
are in table tblStartEnd, then you could do it all with a
query:
INSERT INTO anothertable
SELECT tblStartEnd.Start_Num + tblCount.CountID -1
FROM tblStartEnd, tblCount
WHERE tblStartEnd.Start_Num + tblCount.CountID - 1
<= tblStartEnd.End_Num

Signature
Marsh
MVP [MS Access]