AfterColUpdate Event Example

This example does a lookup when one column is updated and places the result in another column.

Private Sub DataGrid1_AfterColUpdate (ColIndex As Integer)
   If ColIndex = 1 Then
      Data1.Recordset.FindFirst "PubId = " _
       & DataGrid1.Columns(1).Value
      If Not Data1.Recordset.NoMatch Then
         DataGrid1.Columns(2).Value = _
          Data1.Recordset.Fields("Publisher")
      Else 
         DataGrid1.Columns(2).Value = "No Match"
      End If
   End If
End Sub