Need to a "x" records for "x" qty shipped

T

Tim

I need to find a way to add "x" number of records to a
table, based on a users input of "x" qty. For example, if
5 pcs are shipped, I want to have 5 records added to a
table, 1 record for ea unit shipped. Similarly, if 15pcs
shipped, I need 15 records to be added to the table.

I have looked at the repeat / repeat expression in the
OpenQuery macro function, but the repeat only accepts a
number, and not an expression.

Any ideas/suggestions?

Thanks,
Tim
 
A

Allen Browne

If this is just to generate a shipping label for each one, see:
Printing a Quantity of a Label
at:
http://members.iinet.net.au/~allenbrowne/ser-39.html

If you want to actually create a record for each one, you could build a
string that represents a SQL statement the picks up the values from the
form, and uses the Cartesian Product (described in the article above) to
create a record for each one. By using an INSERT statement, you can then
Execute it.

Alternatively, you could OpenRecordset in code, and use a loop from 1 to x
to add a record for each one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top