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 Retention Problem 1

Status
Not open for further replies.

bhujanga

Programmer
Oct 18, 2007
181
US
I have a form the is used for editing permit records. The form is equipped with a combo-box for quickly selecting the permit number you want to work on. Simple enough.

Sometimes a user will want to search for a particular record based on multiple criteria, such as highway, county, date - any combination of about a dozen fields, some of which use ranges and some which accept approximate matches. So I designed a screen where they enter just the info that they want for their criteria, click on a button and a list of qualifying permits comes up. Then they can click on any one of the permits and it will open the editing screen showing the selected permit. Everything has been working fine for the last three years.

Now it seems that some users that have been upgraded to 2007 are having trouble when they open the edit screen directly in that it has retained the filter from the last search, so they don't get all the records. (It still works fine for the 2003 users.) I tried putting the ME.FilterOn = False statement in the load event, but then it doesn't even filter when it's supposed to.

Any ideas? I thought about trying to use a global variable to determine whether to set the FilterOn property, but I don't know how to get global variables to work.
 
P.S. Is there a good way in VB to test whether a particular form is open or not? This would be another way I could determine whether to set the FilterOn property to True or False.
 
Is there a good way in VB to test whether a particular form is open or not?
Test the value of this property:
Application.CurrentProject.AllForms("name of your form").IsLoaded

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That works and I was able to avoid the trouble I'm having by doing it that way.

It would be cleaner if the form didn't need to be conjoled to this extent. I have to wonder if there is a setting somewhere that would allow it to behave the way it always did in 2003 - i.e. by default it opens with all the records but if it is opened from code using a criteria clasue, then it is filtered accordingly, but then automatically goes back to unfiltered the next time it's opened directly.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top