Subform filtering problem

casey

Registered User.
Local time
Today, 23:31
Joined
Dec 5, 2000
Messages
448
Hello,

I have several subforms on a form. Each subform is filtered by an individual row in a listbox located on the form. A VB procedure enables the user to make changes to listbox's rowsource and subsequently change the way the records in it appear. When this happens both the records in the listbox are sorted and the subforms' filters are changed. While this may sound strange, it works well for its intended purpose. My only problem is that, when I initially open my form, the subforms will not filter at all. I have to re-enter design view and then re-open the form for the subforms to filter the way the should. Once re-opened the subforms filter like they're supposed to.

Can someone clue me into why these subforms will not filter upon initial opening? Please let me know what I'm missing here or I need to elaborate further. Thanks
 
Aloha...

What kind of code are you using to get the filter to work?

Maybe you need to put something similar in Form_Current?

Tana
 
Have you tried the Requery function? Check the help files for there are a variety of options of what objects to requery using the DoCmd.Requery command. Maybe you just need to requery the subforms in the OnOpen event of the main form? Or you might have to use code in the OnOpen event to turn the filters on and set the filters values. The help files will give you a decent example of setting filters in code.

HTH
 
Like you said...I put code to requery each subform upon Open() of the main form. I don't know why, but that seems to work so I'll go with that.

Thanks for the help.
 

Users who are viewing this thread

Back
Top Bottom