Results 1 to 5 of 5

Thread: Search Data in MS FLEXGRID

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Search Data in MS FLEXGRID

    Hello
    I have about 100 rows in a grid having Names, I want to search in MS FLEXGRID like THOMAS which is the 68th row, How can i do this ? Please help me

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Search Data in MS FLEXGRID

    VB Code:
    1. Dim lngRow as Long
    2. Dim blnFound as Boolean
    3.  
    4. blnFound = False
    5.  
    6. For lngRow = 0 To MSFlexGrid.Rows - 1
    7.    If MSFlexGrid.TextMatrix(lngRow, 0) = "THOMAS" Then 'change 0 to the correct column #
    8.       blnFound = True
    9.       Exit For
    10.    End If
    11. Next
    12.  
    13. If blnFound Then
    14.     debug.print "Found on Row " & lngRow
    15. Else
    16.    Debug.print "Not Found"
    17. End If

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: Search Data in MS FLEXGRID

    Thanks.
    But how to automatically select that row ?

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Search Data in MS FLEXGRID

    VB Code:
    1. Dim lngRow as Long
    2. Dim blnFound as Boolean
    3.  
    4. blnFound = False
    5.  
    6. For lngRow = 0 To MSFlexGrid.Rows - 1
    7.    If MSFlexGrid.TextMatrix(lngRow, 0) = "THOMAS" Then 'change 0 to the correct column #
    8.       blnFound = True
    9.       Exit For
    10.    End If
    11. Next
    12.  
    13. If blnFound Then
    14.       MSFlexGrid.Row = lngRow 'sets the current Row
    15.       MSFlexGrid.TopRow = lngRow 'moves the row into view
    16. Else
    17.    Debug.print "Not Found"
    18. End If

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: Search Data in MS FLEXGRID

    Thaks brucevde , I solved

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