Retaining Sort Order

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris

    #1

    Retaining Sort Order

    Dear All,

    I have a subform in datasheet view whose record source is a table (not
    a query) A user can right click and customise sort order. Now when the
    form is closed VBA code saves for subform with the intention that the
    sort order is retained. This works fine in an mdb file but with an mde
    the form sort order is not saved.

    To work around this I thought about setting the Order by in the table
    properties but that particular property doesn't appear to be accessable
    through Code. Is this the case?

    Can anyone suggest a workaround.

    Thanks kindly

  • Swans, What Swans?

    #2
    Re: Retaining Sort Order

    1) What code are you using to dynamically change the sort and save the
    changes?

    2) My rule of thumb is to NEVER have a form directly work from table but
    always go through a query.


    In article <1168659402.388 239.137550@s34g 2000cwa.googleg roups.com>,
    chris_wood@silv erbirches.com.h k says...
    Dear All,
    >
    I have a subform in datasheet view whose record source is a table (not
    a query) A user can right click and customise sort order. Now when the
    form is closed VBA code saves for subform with the intention that the
    sort order is retained. This works fine in an mdb file but with an mde
    the form sort order is not saved.
    >
    To work around this I thought about setting the Order by in the table
    properties but that particular property doesn't appear to be accessable
    through Code. Is this the case?
    >
    Can anyone suggest a workaround.
    >
    Thanks kindly
    >
    >

    Comment

    • Rick Brandt

      #3
      Re: Retaining Sort Order

      "Chris" <chris_wood@sil verbirches.com. hkwrote in message
      news:1168659402 .388239.137550@ s34g2000cwa.goo glegroups.com.. .
      Dear All,
      >
      I have a subform in datasheet view whose record source is a table (not
      a query) A user can right click and customise sort order. Now when the
      form is closed VBA code saves for subform with the intention that the
      sort order is retained. This works fine in an mdb file but with an mde
      the form sort order is not saved.
      >
      To work around this I thought about setting the Order by in the table
      properties but that particular property doesn't appear to be accessable
      through Code. Is this the case?
      >
      Can anyone suggest a workaround.
      The sort order of a form in an MDE cannot be changed permanently. You need to
      either store the desired sort in a table that can be looked up and applied upon
      form opening or else use a query and dynamically change the ORDER BY clause of
      the query. That CAN be changed permanently in an MDE and it need only be a
      basic...

      SELECT * FROM TableName ORDER BY FieldName


      --
      Rick Brandt, Microsoft Access MVP
      Email (as appropriate) to...
      RBrandt at Hunter dot com


      Comment

      Working...