Hi All
Several years ago I had one of your experts help me with the following procedure and it worked great. It took the primary key from the parent table and populated it "n number of times" into the 2nd table related table. When I tabbed out of the NumRecords and re-queried the form/subform, I was able to see the additional records in the 2nd table
Private Sub NumRecords_LostFocus()
Dim indx As Integer, Nkey As Integer, returnOkay As String
indx = Me.[NumRecords]
Nkey = Me.Batch
returnOkay = AddRecord(indx, Nkey)
End Sub
Function AddRecord(indx As Integer, Nkey As Integer) As String
Dim rmst As Recordset, indx1 As Integer
Set rmst = CurrentDb.OpenRecordset("tblSamplePLM", dbOpenDynaset, dbSeeChanges)
For indx1 = 1 To indx
rmst.AddNew
rmst![Batch] = Nkey
rmst.Update
Next indx1
rmst.Close
AddRecord = "Aokay"
End Function
I want to do something similar but find that the old procedure will work on only one sub table\subform at a time. Is there a way to populate the 5 child tables with only one record using both the primary key and the 2nd field StructureIdent from the parent table data entry form selection?
Here is a screen capture my present setup and relationships.
Another issue I have, and this could be because of my lack of knowledge in access but any query based on all five child tables is not updatable. Is this done with union queries?
Hope I've given you all the details you need and thank you in advance.
Several years ago I had one of your experts help me with the following procedure and it worked great. It took the primary key from the parent table and populated it "n number of times" into the 2nd table related table. When I tabbed out of the NumRecords and re-queried the form/subform, I was able to see the additional records in the 2nd table
Private Sub NumRecords_LostFocus()
Dim indx As Integer, Nkey As Integer, returnOkay As String
indx = Me.[NumRecords]
Nkey = Me.Batch
returnOkay = AddRecord(indx, Nkey)
End Sub
Function AddRecord(indx As Integer, Nkey As Integer) As String
Dim rmst As Recordset, indx1 As Integer
Set rmst = CurrentDb.OpenRecordset("tblSamplePLM", dbOpenDynaset, dbSeeChanges)
For indx1 = 1 To indx
rmst.AddNew
rmst![Batch] = Nkey
rmst.Update
Next indx1
rmst.Close
AddRecord = "Aokay"
End Function
I want to do something similar but find that the old procedure will work on only one sub table\subform at a time. Is there a way to populate the 5 child tables with only one record using both the primary key and the 2nd field StructureIdent from the parent table data entry form selection?
Here is a screen capture my present setup and relationships.
Another issue I have, and this could be because of my lack of knowledge in access but any query based on all five child tables is not updatable. Is this done with union queries?
Hope I've given you all the details you need and thank you in advance.