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

Insert rows in table with Auto Number

Status
Not open for further replies.

tjbennett

MIS
Feb 8, 2005
95
US
I have a table with an Auto Number field in it. How can I "automatically" add 100 rows, with it auto numbering them?
 

Did you try to add just 1 row? Even 'by hand'?
If so, did it work?

Have fun.

---- Andy
 
Yes I can do that, I want to add 100 more (without doing them one at a time).
 
Where do the 100 records come from? A table from which I manually add 100 records?
 

OK, you can add 'by hand' one record to your table. And you want to add 100 records to it, in code (I assume). Where do you get the information from? Do you make it up as you go? Do you read it from somewhere - if so, from where?

You can do something like:
[tt]
Insert Into tbtMyTable (Select * from tblSomeOtherTable)
[/tt]
or
[tt]
For i = 1 to 100
Insert Into tblMyTable(1, 2, 'abc', i)
Next i
[/tt]

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top