Filter does not work?

DeMarcus

Registered User.
Local time
Today, 14:16
Joined
Jul 14, 2006
Messages
37
Okay, I have a datasheet form. The source is TableData.

I want it to be filtered by date. The date is found on a separate form in txtDate.

So here is what the "Filter" property looks like:

((TableData.Quarter=([Forms]![frmWhatever]![txtDate])))


Now here's the odd part. When I initially put this filter in, it works at first. However, once I save the datasheet form and reopen it, the filter no long works, even though the filter property still remains.

Any ideas?
 
Last edited:
I tried running the datasheet form without having frmWhatever open and it does not give me any errors whatsoever.

This tells me that the datasheet is not even attempting to filter anything.

Hoping for help, thanks.
 
Is the form's 'Allow Filters' property being reset when the form closes and reopens? Something similar happened to me and that was the cause of it.
 
Matt Greatorex said:
Is the form's 'Allow Filters' property being reset when the form closes and reopens? Something similar happened to me and that was the cause of it.

When I look at 'Allow Filters', it says Yes. This is really frustrating. :(
 
Okay, another update.

When I go to the menu at the top and click Records->Apply Filter/Sort, it attempts to apply the filter. How can I get it to apply the filter automatically when I open the datasheet form?
 
When the form opens and the filter isn't working, does the filter property look like it's set to the correct value? If so, perhaps it is being set too late? You could add a message box to the form's OnOpen event and check what it's being set to at that point.
 
Matt Greatorex said:
When the form opens and the filter isn't working, does the filter property look like it's set to the correct value? If so, perhaps it is being set too late? You could add a message box to the form's OnOpen event and check what it's being set to at that point.

At this point, I don't think it's a matter of if the filter's working or not.. The filter apparently works.

It's just that the filter is not being applied automatically. Is there a code that I can put in the Form_Load to apply the filter?
 
Sorry, when I said 'working' I meant 'working for that form'.

The following will set the filter and ensure that filtering is allowed, but if there is something resetting either value after this, you'll still have problems.

[Forms]![form name].Form.Filter = "filter"

[Forms]![form name].Form.FilterOn = True
 
Matt Greatorex said:
Sorry, when I said 'working' I meant 'working for that form'.

The following will set the filter and ensure that filtering is allowed, but if there is something resetting either value after this, you'll still have problems.

[Forms]![form name].Form.Filter = "filter"

[Forms]![form name].Form.FilterOn = True

Thanks so much! That worked like a charm.

The first line, I don't need because I already have it in the form's properties... I wonder if there's a similar field for FilterOn?

But, really, thanks again! You have no idea how much this helps me. :)
 

Users who are viewing this thread

Back
Top Bottom