Results 1 to 9 of 9
  1. #1
    Lounger
    Join Date
    Jul 2002
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reordering Datasheet Columns (Access 2000)

    I have noticed that when you reorder columns in the datasheet view of a query by dragging and dropping, there seems to be no way to resynchronize the order to match the order in the QBE grid. Has anyone figured out how to do this? I want to revert to the default way of operation where you can change the order of columns in the design mode and have that order automatically reflected in the datasheet.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reordering Datasheet Columns (Access 2000)

    There is no built-in way (that I know of) to reset the column order. An easy way out is to switch the query to SQL view, copy the SQL statement to the clipboard and paste it into a new query. The new query will display the columns in the order they are enumerated in the SQL statement.

    Otherwise, you'd have to use VBA and DAO. Fields in a table or query have a ColumnOrder property that can only be set in code.

  3. #3
    Lounger
    Join Date
    Jul 2002
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reordering Datasheet Columns (Access 2000)

    Your SQL suggestion sounds like it would work, although it does require creating a new query. My understanding is that changing the ColumnOrder properties of datasheet columns does not affect the order of fields in the QBE grid, so that method would not resynchronize the datasheet with the QBE grid.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reordering Datasheet Columns (Access 2000)

    You're correct, but you could loop through the fields collection of the table/query and set the column order equal to the field order; this would effectively reset it, so that the QBE grid is synchronized with the datasheet again.

  5. #5
    Lounger
    Join Date
    Jul 2002
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reordering Datasheet Columns (Access 2000)

    Even if you do that, changes in the field order in the QBE grid won't be automatically reflected in the datasheet. So the datasheet column order will match only so long as you don't make a change in the QBE grid order.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reordering Datasheet Columns (Access 2000)

    In that case, I don't know a solution <img src=/S/sorry.gif border=0 alt=sorry width=15 height=15>

  7. #7
    Lounger
    Join Date
    Apr 2001
    Location
    Khon Kaen, Thailand
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reordering Datasheet Columns (Access 2000)


  8. #8
    Lounger
    Join Date
    Jul 2002
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reordering Datasheet Columns (Access 2000)

    Interesting article, Tim, but it still doesn't address the issue of resynchronizing the datasheet with the QBE grid once the datasheet is placed in a different order. This has got to be a common problem. As it says in the MSDN article, many users know that they can just stick the mouse at the header of the column, click to select, and drag the column around. I've got several databases with queries that are already out of synch. I would like to resynch them without having to recreate the queries and lose my column formatting.

  9. #9
    Lounger
    Join Date
    Apr 2001
    Location
    Khon Kaen, Thailand
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reordering Datasheet Columns (Access 2000)

    The way the fields in a query is ordered is based on OrdinalPosition property. Hope this is what you are trying to do.

Posting Permissions

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