Filtering a Subformfrom a Value (1 Viewer)

Tskutnik

Registered User.
Local time
Today, 05:14
Joined
Sep 15, 2012
Messages
228
All Thanks for any help with this. If I can get this first part I can apply it to a lot of other functions I need to build.
In the attached DB there is a form [Recon_HoldErrorsEeco_Menu] with a subform [Recon_PositionErrors_SF].

There is a "Holdings Errors" menu on the left side with values.

The goal is: When the user clicks on of the numbers in the Menu, the subform filters to show only those values. There will be 3 filters and one unfilter function:

1) When Qty and Cash OOB "5" is clicked, the subform OOB column filters to show only the rows with the 5 non blank values
2) When Price vs Mkt Diff "6" is clicked, the subform Price vs. MVal column filters to show only the rows with the 6 non blank values
3) When Qty and Cash OOB "5" is clicked, the subform OOB column filters to show only the rows with the 4 non blank values

The filters do not build on each other. When one filter is selected there are no other activated.

4) The Unfilter Button will clear all filters

If this is a lot of code I apologize, and always appreciate an help.

FYI - In the Functions Custom group there are 2 "mdl..." filters generously provided by MajP. There is a lot of great logic in there for filtering by combo box values, but I am not good enough at this to translate that to what is needed above.

Once this is locked I should be able to apply the same logic to a lot of other similar filtering methods that will be added to this same form.
Thank again for the help.
 

Attachments

  • DailyCalcs - Menu Filter Dev.accdb
    2.7 MB · Views: 17

theDBguy

I’m here to help
Staff member
Local time
Today, 02:14
Joined
Oct 29, 2018
Messages
13,738
Hi. I only added code to the first menu. Hopefully, you can follow it. Let us know if you have any questions.
 

Attachments

  • DailyCalcs - Menu Filter Dev.zip
    311.3 KB · Views: 18

Tskutnik

Registered User.
Local time
Today, 05:14
Joined
Sep 15, 2012
Messages
228
DBGuy - thanks his worked great and yes I can see how to extend it to the other fields.
One question that I'll ping you on offline - if I change the left side menu (that has the click event) to also be a subform it does not seem to work the same.
Seems something in your code below would have to reference the new menu subform instead of "Me"? The subform being filtered is still "Recon_PositionErrors_DB" so that part is the same.

Code:
Me.Recon_PositionErrors_DB.Form.Filter = "Diff_PosQty Is Not Null"
Me.Recon_PositionErrors_DB.Form.FilterOn = True




 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:14
Joined
Oct 29, 2018
Messages
13,738
DBGuy - thanks his worked great and yes I can see how to extend it to the other fields.
One question that I'll ping you on offline - if I change the left side menu (that has the click event) to also be a subform it does not seem to work the same.
Seems something in your code below would have to reference the new menu subform instead of "Me"? The subform being filtered is still "Recon_PositionErrors_DB" so that part is the same.

Code:
Me.Recon_PositionErrors_DB.Form.Filter = "Diff_PosQty Is Not Null"
Me.Recon_PositionErrors_DB.Form.FilterOn = True
It would probably become something like "Me.Parent.Recon_PositionErrors_DB.Form.Filter=" or something like that.
 

arnelgp

error reading drive A:
Local time
Today, 18:14
Joined
May 7, 2009
Messages
11,145
check the code of each Textbox (filter).
 

Attachments

  • DailyCalcs - Menu Filter Dev.zip
    322.4 KB · Views: 20

Users who are viewing this thread

Top Bottom