Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filter by form command button (2000)

    I have a filter by form command button witht he code

    RunCommand acCmdFilterByForm

    I also have a command button to apply yhe filter, but it gets greyed out and canot be pressed once the filter by form command button is pressed
    the code on the button is



    DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70

    Exit_cmdapplyfilter_Click:
    Exit Sub

    Err_cmdapplyfilter_Click:
    MsgBox Err.Description
    Resume Exit_cmdapplyfilter_Click

    any ideaS?
    Best Regards,

    Luke

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

    Re: Filter by form command button (2000)

    Filter by Form disables all controls on the form except those bound to a field in the record source. So your Apply Filter button, or any other command button for that matter, will not work while Filter by Form is active. The user will have to use the Apply Filter button on the toolbar.

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter by form command button (2000)

    Hans,

    Saw this while I was working on a like situation. If you were to use AutoKeys to RunCommand "Filter by Form", is there any way of Applying the Filter via a AutoKeys command? I couldn't seem to find any useable combination, but thought you might have some idea. User wants to press Shift-F10 to goto Filter by Form and then Shift-F9 to Apply the Filter and then Shift-F8 to clear the filter. Did I mention that they are anti-mousing?
    Cheers,
    Andy

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

    Re: Filter by form command button (2000)

    No, that won't work. If you assign the ApplyFilter action to Shift+F9, pressing it while in Filter by Form will cause an error.
    The On Key Down event of the form is ignored while in Filter by Form, so that won't work either.
    The only way to use the keyboard for applying the filter (as far as I know) is to use the accelerator keys for the Filter | Apply Filter menu option.

Posting Permissions

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