J
Jack Leach
Hi all, TIA for any help...
I'm trying to get away from some of my old-fashioned recordset looping
techniques and build a better understanding of how to use SQL (not a strong
point for me) to accomplish the same things. Wondering if someone can give
me a hand.
I've got two tables that hold Required Documentation information... one for
Parts that holds records based on the part, and one for Orders that holds
basically the same records, but allows for there to be order-specific changes
in the requirements for documentation.
As of now, I use two recordsets, rsP(arts) and rsO(rders). I select * from
tblPartRqdTrkDocs WHERE fldPart = SomePartID, loop that recordset and for
each record add a new recordset into rsO, copying the field information.
I know (think) this can be fairly easily done with an INSERT INTO SQL
execution... but I don't know how to set it up. Here's the fields...
Copy from:
tblPartRqdTrkDocs
fldID
fldPart
fldDocID
fldFirstRlsOnly
to:
tblOrdRqdTrkDocs
fldID (autonum)
fldOrderLine (get from form control)
fldDocID (copy from other table)
fldFirstRlsOnly (copy from other table)
I need to be able to copy the fields fldDocID and fldFirstRlsOnly... not
sure how to reference these inside an SQL string? And, how do I have it work
for any number of records for the given PartID?
Any help greatly appreciated... thanks
--
Jack Leach
www.tristatemachine.com
"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
I'm trying to get away from some of my old-fashioned recordset looping
techniques and build a better understanding of how to use SQL (not a strong
point for me) to accomplish the same things. Wondering if someone can give
me a hand.
I've got two tables that hold Required Documentation information... one for
Parts that holds records based on the part, and one for Orders that holds
basically the same records, but allows for there to be order-specific changes
in the requirements for documentation.
As of now, I use two recordsets, rsP(arts) and rsO(rders). I select * from
tblPartRqdTrkDocs WHERE fldPart = SomePartID, loop that recordset and for
each record add a new recordset into rsO, copying the field information.
I know (think) this can be fairly easily done with an INSERT INTO SQL
execution... but I don't know how to set it up. Here's the fields...
Copy from:
tblPartRqdTrkDocs
fldID
fldPart
fldDocID
fldFirstRlsOnly
to:
tblOrdRqdTrkDocs
fldID (autonum)
fldOrderLine (get from form control)
fldDocID (copy from other table)
fldFirstRlsOnly (copy from other table)
I need to be able to copy the fields fldDocID and fldFirstRlsOnly... not
sure how to reference these inside an SQL string? And, how do I have it work
for any number of records for the given PartID?
Any help greatly appreciated... thanks
--
Jack Leach
www.tristatemachine.com
"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)