January 12th, 2012, 11:38 AM
Inserting Duplicate Records
I have a table called steel_tbl with columns ID(auto number), date pno , dia, grade, heatlot, weight, status.
I have a form which I use to insert values into this table.
I have 5 fields on the form. date-textbox, pno-combobox, heatlot-textbox, weight-textbox, bundles-textbox. I have a text box to enter number of bundles. When the user enters 2 bundles I want to create 2 records of the information in the fields. If the user enters 3 bundles I want to insert 3 rows in the table with the same information. Is this possible in MS Access 2000? Any help would be appreciated. Thank you
January 12th, 2012, 02:08 PM
yes, you need an integers table and it's easy
CREATE TABLE integers
( i INTEGER NOT NULL PRIMARY KEY )
then load it up with integer values from 0 through 9 or whatever
INSERT INTO yourtable ( yourcolumns )
FROM integers WHERE i < form.bundles
so if the user enters 4 in the bundles box, the INSERT will insert your values 4 times (once for each of the integers 0 through 3)
January 12th, 2012, 03:47 PM
That's awesome! It works! Thank you so much