Data type in flex grid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akashazad
    New Member
    • Sep 2007
    • 38

    Data type in flex grid

    Hi,

    In my VB application ,I have used a flex grid in which I had cols named Discount and Charges now I want to give a validation that if the person enters the Discount it should be less then Charges,for that I compared the data of Discount col with Zero to check wether the user had entered the Discount or not if Yes then I compared Discount with Charges .

    I have defined the ColDatatype property of both the col as FlexDTDouble.
    **************C ODE************ *************** **
    If vsfgInvestigati ons.TextMatrix( 1, Discount) <> 0 Then
    If vsfgInvestigati ons.TextMatrix( 1, Discount) > vsfgInvestigati ons.TextMatrix( 1, Charges) Then
    MsgBox "Discount should be less then charges", vbInformation, Me.Caption
    Exit Function
    End If
    End If
    *************** ***CODE******** *************** *******
    Now the problem arises when I compare Discount Col with Zero it gives the Error as Datatype Mismatch.

    So which Datatype should I use.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    I think while using ext matrix it considers everything as text not numbers. Try to use Val function before comparing.

    Comment

    Working...