1 2 3 4 5 6 7 8 9 10 11 12
|
Private Sub DataGridView1_CellValidating(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellValidatingEventArgs) Handles DataGridView1.CellValidating
If e.Cancel = True Then
If Me.DataGridView1.CurrentRow.Cells(7).Value <> "" Then
Me.DataGridView1.CurrentRow.Cells(10).Value = Val(Me.DataGridView1.CurrentRow.Cells(4).Value) - Val(Me.DataGridView1.CurrentRow.Cells(7).Value)
Me.DataGridView1.CurrentRow.Cells(11).Value = Val(Me.DataGridView1.CurrentRow.Cells(7).Value) + Val(Me.DataGridView1.CurrentRow.Cells(10).Value)
Me.DataGridView1.CurrentRow.Cells(12).Value = Val(Me.DataGridView1.CurrentRow.Cells(6).Value) * Val(Me.DataGridView1.CurrentRow.Cells(7).Value)
End If
End If |