KComfort16
New member
- Local time
- Today, 03:55
- Joined
- Apr 3, 2020
- Messages
- 6
Background: I have created 3 Forms for our QC Department to complete every Hour for Visual and Measurement Inspections on parts running in the presses. Form 1: Part Selection - Operator will being using a Combo Box to Select the Part and Click a Button to go to Step 2 (Form 2) Form 2: Visual Results - I Pass down the PartID from Form 1 and The Form Pulls the Inspection Criteria (based on the Unique PartID) from a table Titled Inspection - Visual; On the form there is room for 10 Individual Criteria (however NOT all 10 will be used for each Item) and there are 10 UNBOUND Result Boxes for the Operator to Fill out. Upon Clicking at Button and the Form CLOSING I want to Save the results from the PartID, Additional bound boxes (or fields) and the 10 UNBOUND Boxes (or Fields) to a Table Titled Inspection Results - Visual Form 3: Measurement Results - Is Identical with information being passed down from Form 1, but this form pulls its Criteria for a Table called Inspection - Measurements; each Measurement has a corresponding unbound field for the results to be entered.
What I have Tried - Trying to get the Visual Results to work first then I will apply that to the Measurement Results:
1) Linking both Tables to the Form - The Issue I had was - I was not able to get Form 2 (Visual Results) to Pull in the Inspection Criteria and I felt that was because I had 2 Tables Linked to the form - once I removed the Inspection Results - Visual Table from the Link form everything worked as I hoped.
2) I Tried Use the Following Code to have the Values Transferred to the Results Table:
And I have Tried:
What I have Tried - Trying to get the Visual Results to work first then I will apply that to the Measurement Results:
1) Linking both Tables to the Form - The Issue I had was - I was not able to get Form 2 (Visual Results) to Pull in the Inspection Criteria and I felt that was because I had 2 Tables Linked to the form - once I removed the Inspection Results - Visual Table from the Link form everything worked as I hoped.
2) I Tried Use the Following Code to have the Values Transferred to the Results Table:
Code:
Dim rs as Recordset
Set rs = CurrentDb.OpenRecordset("Inspection Results - Visual")
rs.AddNew
rs!PartID = Me.PAID
rs!MoldID = Me.MID
rs!PressIS = Me.PRID
rs!DTC = Me.DTC
rs!Lot = Me.Lot
rs!VR1 = Me.VRI
rs!VR2 = Me.VR2
rs!VR3 = Me.VR3
rs!VR4 = Me.VR4
rs!VR5 = Me.VR5
rs!VR6 = Me.VR6
rs!VR7 = Me.VR7
rs!VR8 = Me.VR8
rs!VR9 = Me.VR9
rs!VR10 = Me.VR10
rs.Update
rs.Close
And I have Tried:
Code:
Dim StrSQL As String
StrSQL = "INSERT INTO [Inspection Results - Visual] ([PartID],[MoldID],[PressID],[DTC],[Lot],[VR1],[VR2],[VR3],[VR4],[VR5],[VR6],[VR7],[VR8],[VR9],[VR10])" & VALUES(" & Me!PAID & ", "Me!MID &", "Me!PRID &", "Me.DTC &", "Me.Lot &", "Me.VR1 &", "Me.VR2 &", "Me.VR3 &", "Me.VR4 &", "Me.VR5 &", "Me.VR6 &", "Me.VR7 &", "Me.VR8 &", "Me.VR9 &", "Me.VR10 &") DoCmd.RunSQL StrSQL