CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2001
    Location
    Memphis, TN
    Posts
    146

    Flexgrid traversal

    I'm trying to traverse a flexgrid to store a value from one columb into a particular array based on the date value of another column. The date value is compared with the Monthview1.Selstart and MonthView1.Selend. I can do a simple comparison like this...

    if frmTools!Flex1.TextMatrix(1,4) < MonthView1.Selstart Then Beep

    ...and it runs just fine. But when i substitute the row value in TextMatrix with a value from a loop, the returned value is a mismatched type. I am really confused and have put in an hours time just fiddling with this line of code. Makes no sense to me. Here is the code i've written, the errors come in the first "If...Then" lines. Thanks already for any help, everyone!

    Dim i As Integer
    For i = 1 To frmTools!Flex1.Rows - 1
    If frmTools!Flex1.TextMatrix(i, 4) > MonthView1.SelStart Then

    If frmTools!Flex1.TextMatrix(i, 4) < MonthView1.SelEnd Then

    Select Case frmTools!Flex1.TextMatrix(i, 1)
    Case "Bellevue"
    Bellevue(senBel) = frmTools!Flex1.TextMatrix(i, 3)
    senBel = senBel + 1
    Case "Brooks"
    Brooks(senBro) = frmTools!Flex1.TextMatrix(i, 3)
    senBro = senBro + 1
    Case "Democrat"
    Democrat(senDem) = frmTools!Flex1.TextMatrix(i, 3)
    senDem = senDem + 1
    Case "Midtown"
    Midtown(senMid) = frmTools!Flex1.TextMatrix(i, 3)
    senMid = senMid + 1
    Case "Scott"
    Scott(senSco) = frmTools!Flex1.TextMatrix(i, 3)
    senSco = senSco + 1
    End Select

    End If

    End If

    Next i


  2. #2
    Join Date
    Feb 2000
    Location
    Ireland
    Posts
    808

    Re: Flexgrid traversal

    Change your declaration of i to long instead of integer as this is what Textmatrix uses


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured