I am trying to fix a query meant to update reel lengths on my main table after the user clicks the print label button. This particular process deals with a sub-form within a sub-form and is giving me a headache.
The first sub-form has parent/child links to the main form and the second sub-form is linked to the first sub-form with parent/child. The numeric fields below the entries are just temporary so I can see the ID's while working on the query.
Sub-form #1 links:
Sub-form #2 links:
The query I am trying to use to update my table is:
The above query only updates a single record from the second sub-form however and is dependent on what record in that form had focus at the time the button is pressed. I have 3 similar queries in other parts of this app and they all work fine except this one has the additional nested sub-form and I believe that is what is causing me problems.
The end result should be the table below gets the 3 reels in question updated with current length after deducting the cut. Which in this particular example, the current length of all 3 of those in the snip should be zero. However after this runs, only one of those entries will update based on whatever record in the sub-form had focus.
Can someone offer insight as to what I doing wrong/missing? This seems like it should be so simple but I haven't been able to figure it out after messing with it most of yesterday and all morning.
The first sub-form has parent/child links to the main form and the second sub-form is linked to the first sub-form with parent/child. The numeric fields below the entries are just temporary so I can see the ID's while working on the query.
Sub-form #1 links:
Sub-form #2 links:
The query I am trying to use to update my table is:
SQL:
UPDATE tblWireRoom, tblColorWire INNER JOIN tblCutColorWire ON tblColorWire.CutID = tblCutColorWire.ColorWireID SET tblWireRoom.CurrentLength = [tblWireRoom].[CurrentLength]-[tblCutColorWire].[CutLength]
WHERE (((tblWireRoom.ReelID)=[Forms]![frmWireRoom]![WireColorsSubCntrl].[Form]![WireColorLengthSubFrm]![WireReelID]) AND ((tblCutColorWire.ColorWireID)=[Forms]![frmWireRoom]![WireColorsSubCntrl].[Form]![WireColorLengthSubFrm]![ColorWireID]));
The above query only updates a single record from the second sub-form however and is dependent on what record in that form had focus at the time the button is pressed. I have 3 similar queries in other parts of this app and they all work fine except this one has the additional nested sub-form and I believe that is what is causing me problems.
The end result should be the table below gets the 3 reels in question updated with current length after deducting the cut. Which in this particular example, the current length of all 3 of those in the snip should be zero. However after this runs, only one of those entries will update based on whatever record in the sub-form had focus.
Can someone offer insight as to what I doing wrong/missing? This seems like it should be so simple but I haven't been able to figure it out after messing with it most of yesterday and all morning.