Hello all

I have this code where i'm validating 2 MSHFlexgrid column to find if there is a same value:


Code:
Text1 = UCase(Trim(Form61.MSHFlexGrid1.TextMatrix(r1, 5)))
      Text2 = UCase(Trim(Form61.MSHFlexGrid2.TextMatrix(r2, 10)))

But what i would like to do is to not validate the full cell value but only the 3 first digit.

These digits are postal code. But i just need to see the 3 first digit.

What do i need to do to do this base on the bellow code?

On the code bellow, i've tried with:
Code:
Text1 = UCase(Left(Form61.MSHFlexGrid1.TextMatrix(r1, 3, 5)))
      Text2 = UCase(Left(Form61.MSHFlexGrid2.TextMatrix(r2, 3, 10)))
But i have this compile error Wrong number of arguments or invalid property assignment.


Thanks again for your help.

Full code
Code:
Dim r1 As Long, r2 As Long, i As Long
Dim Text1 As String
Dim Text2 As String
Dim bFound As Boolean

'Part 1
For r1 = 1 To Form61.MSHFlexGrid1.Rows - 1
   bFound = False
   For r2 = 1 To Form61.MSHFlexGrid2.Rows - 1
   Text1 = UCase(Left(Form61.MSHFlexGrid1.TextMatrix(r1, 3, 5)))
      Text2 = UCase(Left(Form61.MSHFlexGrid2.TextMatrix(r2, 3, 10)))
      If Text2 = Text1 Then
         bFound = False
         Exit For
      Else
         bFound = True
      End If
   Next r2
   
   
   If bFound And Form61.MSHFlexGrid1.TextMatrix(r1, 4) = "8" Then
      Form61.MSHFlexGrid1.TextMatrix(r1, 1) = "ZIP TO BE FIX"
      Form61.MSHFlexGrid1.Row = r1
      Form61.MSHFlexGrid1.Col = 1
      Form61.MSHFlexGrid1.CellBackColor = &H80FF&

      
   Else
     
      
   End If
Next r1