Results 1 to 2 of 2

Thread: Sort and Search with VB 6.0 and access 2003

  1. #1
    New Member
    Join Date
    Feb 08
    Posts
    5

    Post Sort and Search with VB 6.0 and access 2003

    Is there any commands in VB 6.0 that can automatically manipulate fields in MSHFlex Grid?
    so that i can sort or search its cotents? Or, if there aren't any, what is the commands to manually manipulate the contents of the database?
    by the way the flexgrid is connected to ms access via adodc.
    Last edited by chainsmoker9; May 24th, 2008 at 06:57 PM.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 02
    Location
    Bristol, UK
    Posts
    35,562

    Re: Sort and Search with VB 6.0 and access 2003

    To read the contents of the cells, you can use the .TextMatrix property of the grid, eg:
    Code:
    strValue = MSFlexGrid1.TextMatrix(2,3)
    To sort it, you can use the .Sort method (see the help for details and examples).


    However.. it is generally better to let the database do the work instead (particularly for a search), by running an apt SQL statement to get the data you want.

    To load the data sorted, simply add an Order By clause to the end of your SQL statement. If you want to allow sorting after it has been loaded (but keeping the same data), it is more efficient to use the grids .Sort method.

Posting Permissions

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