Results 1 to 2 of 2
  1. #1
    mikeal_a@yahoo.com is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    1

    Sorting a filtered form

    Hello,

    I am using Access 2010 and have a continous form in with a text box that on exit will filter records:

    Me.filter = "TestCaseTitle Like '*" & Me.txtKeyWord & "*'"
    Me.FilterOn = True

    The filter works fine. I also have buttons in the form header above each column of data that when clicked will alternate between sorting ascending and descending:

    'example of button that calls sort
    SortTestCaseInfo ("GameName Desc, PriorityID, TestCaseTitle")

    Private Sub SortTestCaseInfo(sOrderBy As String)
    Me.OrderBy = sOrderBy
    Me.OrderByOn = True


    End Sub

    Both the filtering and sorting work fine on their own. However, If I run the filter first, then attemt to sort, or change any row data the controls do not seem to respond at all. I must put the form into design view and then the sorting works along with ability to change data. Basically, none of the events of the button are firing after the filter is turned on unless I go into design view... When I go back to form view the filter is still set and the sorting (buttons) work great. Any Suggestions.

    Thanks,
    mike

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Instead of using a filter on your form, try running your form from a query and the items you're putting in your filter apply as a criteria to the query that runs the form.

    I'm not exactly sure how filters affect the ability to change data but filters, in my experience, are a pain in the ass and I'd much rather do things with queries.

    If you're determined to keep using the filter property is there any chance you could upload a copy of your database for examination (2003 if you can)?

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

Similar Threads

  1. Sub form filtered by listbox
    By BorisGomel in forum Forms
    Replies: 3
    Last Post: 05-04-2011, 09:20 AM
  2. Replies: 2
    Last Post: 01-15-2011, 10:56 AM
  3. update query fon a filtered form HELP!
    By campanellisj in forum Queries
    Replies: 0
    Last Post: 11-12-2010, 09:08 AM
  4. Open form to filtered records
    By ducecoop in forum Access
    Replies: 3
    Last Post: 10-22-2010, 10:53 AM
  5. making a table from a filtered split form
    By stephenaa5 in forum Queries
    Replies: 2
    Last Post: 08-25-2010, 08:56 PM

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