Comparing the values in 2 cells in a MSFLEXgrid control..
Posted on 2004-10-29
I have a flex grid control with 4 columns and I have to check wheather the value entered in 2nd column is greater than the value entered in the 3rd column of each row.
I am writing the code on the leavecell event but the code fires everytime I press a key. I want to execute it only when I leave the cell and move to another one or move the focus to another control.
My code is
Private Sub MSFlexGrid1_LeaveCell(index As Integer)
If MSFlexGrid1(index).Col = 3 Then
If MSFlexGrid1(index).TextMatrix(MSFlexGrid1(index).Row, 2) > MSFlexGrid1(index).TextMatrix(MSFlexGrid1(index).Row, 3) Then
MsgBox "Wrong Value"