• ApplyFilter Event

    Author
    Topic
    #356475

    On My main form, I have 6 subforms. All are opened, yet only 1 is visible at a time. The user can select which subform to view by choosing its name from an option group.

    If the user selects a specific value in one subform and filters it using the FilterBySelection button, all is fine until a different subform is selected. The filter, of course does not apply, automatically, to the other 5 subforms.

    I have captured the Me.Filter value and stored it in a hidden textbox on the main form. And I have tried to apply that same filter to each subform using their respective OnEnter events. The process works, almost!

    What I had not planned on was when I set a subforms Filter property programatically, the subform’s ApplyFilter event fires. This causes a problem because it constantly modifies the value stored in that hidden textbox, effectively destroying the filter value text I am referring to.

    First Question (finally!): Is the ApplyFilter event really supposed to fire when the Filter property is set via code?

    Second Question: Can anyone think of a better way to accomplish what I am trying to do?

    Thanks for your patience. And I look forward to all the creative answers!

    Regards,

    Rich P. headthrob

    Viewing 0 reply threads
    Author
    Replies
    • #527707

      I’m not sure about the applyfilter event but it sounds like its working as expected. You might try a lost focus action to reset the records as you leave the subform.

      I would do the 6 subforms as tab controls I think it would be a lot simpler than your method.

      • #527712

        My understanding of the applyfilter event is that it applies whenever you click on the apply filter button and its corresponding menu command. One way you can test event timing is by placing message box statements in the events you are interested in.

        As far as the design I’d have to agree with Caz. I have an application with 3 subforms on one main form. I use a 3 paged tab control with a different subform on each page and the users love it.

    Viewing 0 reply threads
    Reply To: ApplyFilter Event

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: