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

removing filter when opening form

Status
Not open for further replies.

JasonPurdueEE

Technical User
May 21, 2002
131
US
ok, I figured out my problem with my form. when I first open it there is a filter in place. when I right click and select remove filter my form will then work great. how do I get it to open and remove the filter automatically? I tried going to the form properties and disallowing the filter, but all this did was not allow me to remove it. so how do I remove the filter and then not allow future filters? and what is setting this filter? thank you.

JASON

P.S. This is on my cascading combo boxes form that you may have read about here in the past 10 days or so.
 
I dunno. Maybe when you used a wizard to create a control it included code that is turning a filter on. I'd suggest opening your VB editor and searching the current project for "filter". As far as I know, Access doesn't automatically apply a filter to a table when it is opened, but you might look into this. If you don't want any filters, you might delete any that exist.

dz
 
Turn the filter off in the form's Load event.


Private Sub Form_Open(Cancel As Integer)
Me.Filter = ""
Me.FilterOn = False
End Sub



Brett
 
FoxPro, there was nothing in the vba code with filter in it. nothing remotely close to it. and turning the filter off like you suggested Brett didnt work either. so far the only way its working is to manually right click in a text box and select remove filter. what the heck? this is weird.
 
<this is weird.>

I'll say! lol

If you open the table in Datasheet View and click Apply filter, is it the same filter that is being applied to your form? dz
 
when I open the form in datasheet view it filters it to only one record just as it does when I initially open the form in form view. when I remove the filter it displays the whole table. so yes, it is doing the same thing to the form in datasheet view as it is in form view. too strange.
 
Please read my post again. I was asking what happens when you open the table in Datasheet View, not the form. dz
 
my bad. when I open the table VarianceCommentary in datasheet view the whole table opens and the apply filter button is not available/greyed out (I cant click it). so I assume its not a filter on the table causing this. its prob in the form someplace, right?
 
Yes, that's what I was trying to determine. It doesn't sound like the table has a filter attached to it. Just to make sure, you might open the table in design view. Right click inside the design grid and select Properties. See if there is anything in the Filter property. Other than that, I've run out of ideas on this one. Sorry that I couldn't help more. dz
 
nothing in the filter properties of the table. this is weird. I am going to try to recreate the form from scratch (now that I know what I'm doing, lol). thanks for you help FoxPro, anybody else have any ideas? I've posted the same question to another forum and have stumped them as well. let me try to redo it all over again.
 
ok, figured this one out by surfing the MSDN pages (believe it or not) :)

I added this to my form's on open event procedure:

DoCmd.ShowAllRecords

works like a charm now. just thought I'd share for others who may experience the same thing.

JASON
 
Thanks, James...I haven't ever had to do that so something is strange with your form. You might check for ghosts inside your comuter. lol dz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top