Write mutiple records for each match

  • Thread starter Thread starter Don Nemitz
  • Start date Start date
D

Don Nemitz

I am trying to write a query that will make a table.
For each record found in the source table, it needs to
make several records in the target table.
Can this be done with a query? If not, will I need to use
VB?
Any ideas?
Thanks
Don
 
Don

With a typical,well-normalized relational database design, it seems unlikely
you'd need "several records" for each one found in a source table. Could
you give an example that could help me better understand your situation?

More info, please...

Jeff Boyce
<Access MVP>
 
Jeff,
Glad to.
The database will have the shipping address of each store.
I need to select a group of stores, then generate a table
of information with the store address plus additional
colums from a second and third table.
For each instance found in the address table, 1 record
should be created in the Process table with all the
address information + Ground Shipping options. The same
query should also create 50 records in the Process table
with all the same address information + Overnight shipping
options.
The resulting table is attached, via ODBC, to an automated
shipping system for batch processing of shipping lables.
There is no count or secondary lookup available via the
ODBC connection, so for each record selected in the
address table, 51 records need to be created in the
Process table.

tblAddresses contains the shipping address of all the
branch offices. It has a Y/N column named Process.

tblAddOn contains information about Shipping options,
Service level, package weight, and other requred items
that change depending on the service needed.
This table will have only 2 records

tblProcess is created every time the query is run, it will
contain 51 records for each "Y" found in the Process
column in tblAddresses. The record will constist of the
values in tblAddreses plus the values from tblAddOn plus
an AutoIncrement count field.

Once the batch has been run, the data is no longer needed.

Does this make sense?
Thanks
Don
 
Back
Top