How to add a new record to a child record in the DataEnvironment with data from 3 unbound text entry boxes. I type entries in these boxes and click on the AddnewChild button. No refreshing is needed.
Assumes ChildRecords is a child command of a parent table and appears as a field (ChildRecords) in the parent list. DatagridC is connected to ChildRecords.
Sub AddNewChild_Click()
Dim rsChild As Variant
Set rsChild = DataEnvironment1.rsParentRecords.Fields("ChildRecords"

.Value
DataGridC.AllowAddNew = True
DataGridC.SetFocus
rsChild.AddNew 'shows new record row
rsChild.Fields("ChildFirstName"

= ChildFirstName.Text 'or rsChild.Fields(0)=
rsChild.Fields("ChildSecondName"

= ChildSecondName.Caption ' ''or rsChild.Fields(1)=
rsChild.Fields("ChildAge"

= ChildAge.Text
DataGrid9.AllowAddNew = False
ChildFirstName.text= ""
ChildSecondName.Text = ""
ChildAge.Text = ""
Set rsChild=Nothing
End Sub
Any data in child records can be read or written to by using rsChild.Fields(N) and you can use all the usual rsChild.MoveNext or EOF etc. but you dont see the drop down lists.