associate the advanced filter feature to a button on the form

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
My program is for users with very little Access/programming experience. Basically data entry type people.

therefore I try to make things as easy as possible.

I want to give them a "search" feature to search a form.

To start: I have a form that has several tabs (pages). Each has a subform. So there are more than one subform on this Form.

I want to include a button that will let the user use the Advance Filter by Form function for one of the Subforms (if that's possible).

So I need to have a button that activates that feature (hopefully for the one subform - frmPIDLibrarySearchsubform) and then another two buttons for Apply Filter/Sort and Clear Filter.

If I cannot do it for just one of the subforms, I will have to deal with that and just make sure they know to clear any filters before going to another tab/page. But hopefully I wont have to complicate things. I know someone will forget and either call and ask why the other tabs/pages are hosed or they will just **** and moan and say the program sucks - lol
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
These buttons already exist on the menu bar.
The subForm properties,should allow you to use Filters. (Or not)

note:using lots of subforms can cause 'out of memory' errors.
i use 1 subForm then change the source data when user changes the tab.
but if your way works,don't change.
 
Upvote 0
I don't want the menu bar shown, too many possibilities for user errors. Like I said I want this to be easy for nonprogrammers. I need a simple button, that activates the advance function, on the form that says Search
 
Upvote 0
You can invoke the built in 'filter by form' function with DoCmd.RunCommand acCmdFilterByForm
if that's what you're asking, but this will disable all buttons on your form, thus you'd have no way to apply the filter other than using the built in button on the Ribbon, so what would be the point? I have been faced with your sort of issue before, and sometimes, you just have to provide training. Even having done so in the past, I have found (and so would you) that in spite of all your built in messages, training, whatever, all you are going to do is find a bigger idiot (sorry if that's rude) or at least find someone who cares less, than you had up until then.

Be that as it may, assuming we're talking about a tab control here, if you properly put the buttons on a page, they can only be seen on that page. I would create the buttons and place them on the tab control somewhere in case you want to add this functionality to one or the other pages later. The button click events should apply or clear the filter. However, you will have to provide your own field(s) or method on which the user can employ to apply the filter without using the built in form.
 
Last edited:
Upvote 0
Thanks. Yes you understood what I was saying.

Unfortunately you cannot avoid the idiots. Example: had a a couple of cells on an excel sheet, made them grey put in the pop-ups message boxes "STOP DO NOT ENTER ANYTHING IN THIS FIELD OR CHANGE IT IN ANY WAY". What happens? Yes, an IDIOT enters data. Why? "I didn't know where else to put it" - how about any other cell!!!!

Thanks again
 
Upvote 0
If you do not want the users to change something, the onus is on you to prevent it.
As you have discovered, they mostly cannot be relied on.

As mentioned you could protect ranges, generally with formulas from being changed. You would need to do exactly the same with controls on forms.

Thanks. Yes you understood what I was saying.

Unfortunately you cannot avoid the idiots. Example: had a a couple of cells on an excel sheet, made them grey put in the pop-ups message boxes "STOP DO NOT ENTER ANYTHING IN THIS FIELD OR CHANGE IT IN ANY WAY". What happens? Yes, an IDIOT enters data. Why? "I didn't know where else to put it" - how about any other cell!!!!

Thanks again
 
Upvote 0

Forum statistics

Threads
1,221,692
Messages
6,161,351
Members
451,697
Latest member
pedroDH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top