Add multiple new records based on quantity duplicating data

A

Access_toddler

I am creating a simple form to allow a new user to list a part number and
requested quantity.
Upon executing a submit button, I would need the part number value
added/duplicated into an existing table as many times as the requested
quantity.
However, the requested quantity can not exceed 999.
 
A

Allen Browne

Simplest solution if you are familiar with code would be to OpenRecordset,
and AddNew in a loop.

An alternative would be to create a table containing 999 records, and use it
as the source table for an Append query statement, with criteria limiting it
to the desired number. This link explains how to create the table and add
the records:
http://allenbrowne.com/ser-39.html

(BTW, the same code also illustrates how to do an AddNew in a loop.)
 
Top