Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2005
    Posts
    23

    Unanswered: Filtering Detail Data From Form Header

    I am creating a runtime version of software and will not have access to menu commands. I am creating a button that should work the same as the "Apply Filter" button.

    The problem I am having is that functions like:

    DoCmd.RunCommand acCmdApplyFilterSort
    is not working...

    There is a focus issue between the header and the detail section of the form. It essentially just filters by the first indexed record and doesn't filter based on where the focus is in the detail section of the form.

    Has anyone run into the same problem?

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I think you might just need a PreviousControl.SetFocus in there before you run the filter.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Aug 2005
    Posts
    23
    Thanks. But that didn't solve the problem. Here is the code:

    Screen.PreviousControl.SetFocus
    DoCmd.RunCommand acCmdApplyFilterSort

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Now try

    Code:
    Screen.PreviousControl.SetFocus
    DoCmd.RunCommand acCmdSortAscending
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Aug 2005
    Posts
    23
    I tried that before and it worked. I still don't know why the filter is not working.

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    What is it you are expecting the command to do?

    ApplyFilter applies the defined filter... are you defining that filter?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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