I have a form for CustomerOrders that uses a query that pulls field data from CustOrders MANY table and the related EngData1 ONE table. There are a few related fields in the ONE table that I need to save in the CustOrders MANY record that show the state of the related fields at the time of the order input.
My Simple question...How do I save some related table fields from the ONE table to the MANY record? What is the proper syntax?
Please keep in mind, I don't want to hear about 99.99% of the time you should never save ONE table data to the MANY record. In this case it needs to be done.
This seems straightforward but I am not getting the related field data to save. Here is example code:
The only field data that appears to be saving is the cboPrintNo.Column(x) from a comboBox on the form. All other field data comes up as null when I know it is not null.Code:Private Sub Form_BeforeUpdate(Cancel As Integer) 'Provide the user with the option to save/undo 'changes made to the record in the form If MsgBox("Changes have been made to this record." _ & vbCrLf & vbCrLf & "Do you want to save these changes?" _ , vbYesNo, "Changes Made...") = vbYes Then 'Save some info and then "DoCmd.Save" Me.Text265 = Me!ID Me.EngDataID = Me.ID Me.PENETRANT = Me![PENETRANT INSP] Me.[HEAT TREAT] = Me![ENGDATA1_HEAT TREAT] Me.[MAG PARTICLE] = Me![MAG PARTICLE INSPECT] Me.[OTHER] = Me!ENGDATA1_OTHER If (Me!cboPrintNo.Column(4) = "") Then Me.CLASS = "N/A" Else Me.CLASS = Me!cboPrintNo.Column(4) End If Me.[CLASS 2] = Me!cboPrintNo.Column(5) Me.BLASTING = Me!ENGDATA1_BLASTING Me.[MATERIAL] = Me!ENGDATA1_MATERIAL 'Save the record DoCmd.Save Else DoCmd.RunCommand acCmdUndo End If End Sub
Thanks...