1000 entries

  • Thread starter Thread starter Amy Blankenship
  • Start date Start date
Table for box number. Box number autonumber, location text, description
text. Start numbering at 1. I want to build 1000 records. Is there a way to
do this without filling in location and description? Like hitting the new
record button on the record selector 1000 times making 1000 blank but
numbered records.

The only thing I could think of is to have a dummy field call number where I
would have to manually put in the same number as the autonumber so a record
could be created.
 
I can't imagine why you want to do this but if you put this code in a module
and from the immediate window type InsertRowsTest and hit enter you will
have a table that has one thousand more rows than it had before.

Public Sub InsertRowsTest()
Dim i As Integer
For i = 1 To 1000
CurrentDb.Execute "Insert into [Box Number](Location) Values(null)",
dbFailOnError
Next
End Sub

The above assumes that the table name is "Box Number" and one of the column
names is "Location", and the column "Location" can accept a Null value.
 
I'm recreating an inventory listing. We are adding new boxes in the 1000's
that contain records from our clients. The list is active now except we keep
track in Excel.

I want to enter the contents of the older boxes from a form in access but I
need that pre 1000 number to exist (as a box number). And I want the number
to be an autonumbered key. Make sense? If I had 1000 boxes in my box table
right now, I could enter all the inventory from a form that asks me the box
number and what it is I'm putting in the box because the box exists.
thanks.
 
Have you tried just copying the data from Excel, selecting the entire last
row in the table you want to move the data to, and pasting in your data?
That's why I asked, cause that's what I thought you were doing, and that's
the way I would do it.

If you want to do it through a form, the default new record button should
create each new record as it's needed. So I'm still not really sure why you
want to create 1000 new blank records in advance of any data.

But whatever...I think someone else has already told you the mechanics of
doing so through code if that is what you really want.

-Amy
 
Thanks Ron. And you too Amy. For Amy, I need the 1000 records because I'm
transferring records from excel. We already are using the first 1000 record
numbers so when I transfer data to Access, that box number needs to exist in
my table. Anyway, thanks much.
 
Back
Top