Results 1 to 9 of 9

Thread: Mshflexgrid

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2000
    Posts
    462

    Mshflexgrid

    Trying to Do a sort of this Grid from Data Extracted from a Database.

    When I run this Routine to Do A header sort the Information Is on the bottom of the Grid
    VB Code:
    1. With FlexGrid
    2.    .RowSel = .Row 'forces grid to Sort all rows
    3.    .Col = 1
    4.    .ColSel = 3
    5.    .Sort = flexSortGenericAscending
    6. End With
    Amy suggestions
    Don
    (OLD DOS Programmer)

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Mshflexgrid

    It might be easier to sort the data, via your SQL statement the retrieves it from the database, before you populate your grid with it.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2000
    Posts
    462

    Re: Mshflexgrid

    What I am trying to do is a Header Sort I mean use row Zero's Header columes names for the sort.
    I do an alpha sort on loading
    Don
    (OLD DOS Programmer)

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

    Re: Mshflexgrid

    the Information Is on the bottom of the Grid
    Can you explain the problem better. What information is on the bottom?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2000
    Posts
    462

    Re: Mshflexgrid

    Once I click on the header The sort Routine I posted Will do its thing But all Blank Cell appear First with Data Being Last cells In the grid.

    What i am tyring to do is sort by name for all inputs of the assingment sheets.

    I wish to also but the grid by date
    Don
    (OLD DOS Programmer)

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2000
    Posts
    462

    Re: Mshflexgrid

    Let me better explane this problem I have

    I was trying to do a colume sort by employee name so that I could get all assignment sheets for employees that was in my database.

    this way I could print/edit any of the entrys.

    The problem I came up with is that when using the sort for the msflegrid I found that all cell that were blank came up first and the ones with data came up on the bottom of the grid.

    I use the Row location of the sheet as a way to load that sheet.
    Don
    (OLD DOS Programmer)

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

    Re: Mshflexgrid

    The Flexgrid treats every row as data, if you have blank cells where an Employee Name is also located, where would you expect them to be placed. If you want the blanks at the bottom and the names starting at the top , sorted in ascending order then

    1) sort the entire grid in descending order.
    2) find the last row that contains an employee name.
    3) sort from the first row to the last row from step 2 in ascending order.

    But it sounds like you have multiple rows per employee name. Maybe post a screenshot of the grid before the sort has occurred.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2000
    Posts
    462

    Re: Mshflexgrid

    Ok I can ge a screen shot but how do you put it on here
    Don
    (OLD DOS Programmer)

  9. #9
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Mshflexgrid

    You just need to attach it.. to do that, go to "Post Reply" (instead of the Quick Reply box below), and then click on the "Manage Attachments" button.

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