BeforeUpdate Event Example

This example displays a message that tells the user to enter a value in the first column before the grid can be updated.

Private Sub DataGrid1_BeforeUpdate (Cancel As Integer)
   If DataGrid1.Columns(1).Value = "" Then
      MsgBox "You must enter value in the first column!"
      Cancel = True
   End If
End Sub