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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default Filter on a Form not what I want 2

Status
Not open for further replies.

JoJoRly

Technical User
Jul 22, 2005
7
0
0
US
Hi:

Is it possible that Access saves a default filter with a form? I have somehow introduced a problem into my database that I can't figure out how to resolve. I have a main form which contains two subforms. I have created three command buttons on the main form which, when clicked, launch macros that apply different predefined filters to the form. (This was working very nicely until I broke it.) During the course of working on this form, the data in one of my subforms stopped displaying on the main form whenever I clicked the filter buttons. I discovered a work-around that if I clicked the filter by form icon, and then the "Clear Grid" icon, and then the apply filter toggle, the filter would again work as before and display the data in the subform. My theory is that somehow, a default query has been saved with the form and is being applied first before the filter I have on the command button. I have looked through the Help Text on line and in these forums and can't find anything that discusses a default filter or how to clear it. Can anyone provide any suggestions? Thanks!
 
Hi
If you look at the form or subform in design view, you will find any filter applied on the Data tab of the Properties sheet. Other places filters are stored include queries and tables. You will find these filters on the property sheets for each (right-click in design view).
 
Thank you Remou for your response. It is greatly appreciated.

I did review the filters that are applied per the properties on the form's data tab and these were as I wanted them to be. I still believe that Access was somehow retaining the conditions of an earlier filter by form action and applying these first before applying the current filter request. The problematic symptom was that the data in one of my subforms would not display after clicking on a filter command button. However, if I first opened the Filter By form icon and chose "clear grid", my filter command button would then work with the desired display of data on the subform. I think the required action to fix my problem was to somehow clear what access was saving "behind the scenes" on the filter by form request. I just couldn't figure out how to do that.

But because of your response, I noted the "Allow Filters" property on the main form's datasheet and by playing with that, I accidentally fixed the problem (perhaps somehow "reset" the database) by doing the following: On the Main form property sheet's data tab, I changed the Allow Filter property to "no". This disabled the Filter by Form icon when I had the main form open. Then I clicked on my filter command buttons and noted that they were now filtering with the desired display of the subform (just like yesterday before I had any problems!). I went back into the main form property sheet and set the allow filter property to "Yes" and I am still getting the proper display. So this step must have "reset/cleared" something in the database.

I am not a programmer but I am doing quasi-programming things and lack the education to understand why this fixed the problem. Somewhere out there is a technical explanation for the problem I caused and the reason that changing the Allow Filter property from Yes to No to Yes fixed it. Again, I keep thinking some property in the database had data in it and has now been cleared.

Again, I greatly appreciate you getting back to me and am happy that the problem is currently solved.

Sincerely,
JoJoRly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top