Results 1 to 3 of 3
  1. #1
    MatthewGrace is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    163

    Filtering by Name seems to remove Sorts...

    I have a form in datasheet view, whose Recordsource contains both an Order Date field and a CustomerFK field. The Orderdate field is sorted ASC.

    Simply right clicking the CustomerFK field and Filtering by say "3", naturally yields BOTH all orders from CustomerFK=3 AND preserves the Orderdate field sort ASC. Of course, since nobody likes to Filter by CustomerFK, but rather, the customers actual name, I use a combobox populated with the FK in the bound field and the Name in the second column. No problem.

    The kicker is this: Filter by the Customer's actual name and you lose the sort on Orderdate ASC. Not so if you filter by the FK number directly. Why so?

    I figure it's a common issue. I've made a super-simple db to illustrate with 2 forms, one working, one not. What is the accepted way of circumventing this?

    Filtering removes sorting.zip

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,616
    I don't know that there is a circumvention. I never observed this because don't have any db with lookup alias. Don't ask me why, it's just the data I work with.

    In my primary, large db I disable ribbon and right click menu. I build custom filter tools on form using VBA to construct filter string and apply to form Filter property.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    MatthewGrace is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    163
    Interesting. I have a feel it's a natural limitation of the intrinsic datasheet controls that ship with Access. I've notice a bunch of little "if's and's and bugs" with form controls even as a fairly low level Access User. I guess this is just one more.

    I can either resolve it June's way, writing her own filter tools, which makes sense. The only other way I can think of is to use the ApplyFilter event to "tack on" '[DateOrdered] ASC" to the .Orderby property when it's warranted, so it doesn't get lost in the mix. Hmph.

    Will mark as solved shortly, I'll let anyone else weigh in tho.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Cascading form - of sorts
    By batteryman in forum Forms
    Replies: 1
    Last Post: 08-12-2015, 08:25 AM
  2. Unmatch query of sorts
    By buckmurdock in forum Queries
    Replies: 5
    Last Post: 07-06-2015, 07:08 PM
  3. Complex Sorts in Datasheet View
    By Paul H in forum Forms
    Replies: 4
    Last Post: 05-09-2014, 10:10 AM
  4. Sort - of sorts
    By Needlejockey in forum Reports
    Replies: 5
    Last Post: 04-13-2012, 01:51 PM
  5. remove filtering of a form
    By maxbre in forum Forms
    Replies: 3
    Last Post: 10-30-2010, 10:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums