Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter By Form disables all controls

Status
Not open for further replies.

bronc

Instructor
Aug 28, 2003
145
GB
I place a button on a form to make a filter using

DoCmd.RunCommand acCmdFilterByForm

After choosing the filter by checking the boxes etc I would then like to Apply the filter using

DoCmd.RunCommand acCmdApplyFilterSort

in another button or checkbox or whatever. The only problem is that it seems all buttons etc are disabled (except of course the controls which are bound to the data)on the Filter by Form form. I don't want to use a menu or toolbar toggle I wish to do it from the form.
 
Code:
DoCmd.RunCommand acCmdApplyFilterSort

That is a new one to me but it looks like it should turn the filter of the form on like running...


Code:
Me.Filteron = True

That line is almost always preceded by a line that sets the filter...

Code:
Me.Filter = "ID = 5"
Me.Filteron = True

The example above filters the form to ID to 5.

I hope this gets you where you want.
 
There's no need to set a filter in code. Filter is set implicitly when using the Filter by Form. Of course Filteron = True is an alternative but that is not what I was enquiring of.

The question I was posing is how do to place code in a control when all of the controls are going to be disabled when Fiter by Form is implemented.
 
How are ya bronc . . .

[blue]FilterByForm[/blue] disables all unbound controls so there not accidently included in the filter. This would raise an error! ...

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top