sequencing make quantity

  • Thread starter Thread starter Ryan Arledge via AccessMonster.com
  • Start date Start date
R

Ryan Arledge via AccessMonster.com

Have a serial number database. Have a table that includes the field
"fmqty" (make quantity), which is the quantity of the particular job to
make. Need to have an action so that multiple records are created to match
the #.

For example, if fmqty = 4, then after the action, the table needs to have 4
identical records (previously just 1), with a new field that ID's the
particular unit of the 4 (i.e., 1/4, 2/4, 3/4, 4/4). Can simply have the
new field be "1", "2", "3", "4" - this will work for my purpose.

Any ideas?

Ryan A
 
The answer will involve executing an Append query statement to add the extra
records.

You can create a table with counting values, and set up your query so that
it returns the desired number of records. There is an example of this kind
of cartesian product query in this link:
http://allenbrowne.com/ser-39.html
Although the link is to make records for a report, you can use the same
approach in your Append query.
 
Ryan

It sounds like you are describing a "one to many" relationship. In Access,
it isn't advisable or necessary to create "empty" placeholder rows in a
related table.

Using forms, create a main form based on the main table. Create a second
form, based on the related table. In design mode on the first (main) form,
insert the second form as a subform. NOTE: this will require that the
second table have a foreign key field that points back to the main table's
primary key.

Now your form is ready. Add a new (main table) record in the main form.
When you click into the subform, it will automatically add the related
foreign key. Put in as many as you need, when you have them.

Jeff Boyce
<Access MVP>
 
Back
Top