AfterInsert Event Example

This example creates an entry in a related table if the user enters a value in a column in the grid.

Private SubDataGrid1_AfterInsert ()
   If DataGrid1.Columns(1).Value <> "" Then
      Data2.Recordset.AddNew
      Data2.Recordset.Fields("PubId") = DataGrid1.Columns(1).Value
      Data2.Recordset.Update
   End If
End Sub