Filtering via a query on a form

already

New member
Local time
Today, 22:16
Joined
Apr 24, 2009
Messages
5
Hello
On my access 2007 form I have a button for filtering my data (macro > applyfilter > query for filtering)
Each time I push this button the filter is copied in the property sheet for the form in the filter section. The ‘filter on load’ and the ‘allow filter’ property is set to No.
How can I avoid that the filter is copied to my form. My form is not based on this query only the button.
In access 2003 I didn’t have this problem.
With adding ‘requery ‘ in my macro the button works fine (but the first time after opening my DB it is quering twice instead of once) If I remove the ‘requery’ from my macro the button didn’t work. Only the filter status changes from unfiltered to filtered and the ‘toggle filter’ button is highlighted.
Thanks in advance for your advice
Kind regards
Al
 

On my access 2007 form I have a button for filtering my data (macro > applyfilter > query for filtering)
Each time I push this button the filter is copied in the property sheet for the form in the filter section. The ‘filter on load’ and the ‘allow filter’ property is set to No.

How can I avoid that the filter is copied to my form. My form is not based on this query only the button.


uhm, i'm confused. why don't you just delete the button/macro? then you won't have the filter effect that you don't want?
 
hello Wiklendt

My goal is to use the macro button so that I can quick filter my data.

As already mentioned this macro works fine in 2003. I think it is possible to resolve this issuie in 2007 but I can't find a solution.

Thanks anyway for your reply

Kind regards

Al
 
He already could you post the basic code and process that you use to filter your data - this is almost exactly what I am trying to do (In fact I have just posted a thread here after a frustrating search!!)

Thanks, I'll keep watching this thread, and hopefully learn how to do this myself!

:D:D
 
Hi Bird_FAT

Sorry but I didn't use code for this. My filtering is done by a query and a simple access macro. Applyfilter with the query name.

Kind regards

Al
 
hello Wiklendt

My goal is to use the macro button so that I can quick filter my data.

As already mentioned this macro works fine in 2003. I think it is possible to resolve this issuie in 2007 but I can't find a solution.

Thanks anyway for your reply

Kind regards

Al

sorry, i misunderstood your post.

i have a similar things that happens with a report that i filter using VBA. however, this is only evident when i choose design view of the report that has already been filtered. it could be an ac2007 bug...

when i close the report, and then open it again, even if i save it, then there is no filter, unless i open it via my filter-form (my code is in the button click event, like yours).

does the filter get in the way? does the filter and un-filter parts work as expected? or is this just a quirk that's bugging you?

also a little confused by what you mean "quering twice" and the fitler status changing with the toggle - surely that's expected?
 
Hi Wiklendt

The filter works as expected. But the problem that I have is that I have to put a 'requery' in my macro and because that my query ask for input via a message box it shows twice at first use. Once for the 'query' and once for the 'requery'. For me it is not so a problem but for other users of my database it should be.

Kind regards

Al
 
Hi Wiklendt

The filter works as expected. But the problem that I have is that I have to put a 'requery' in my macro and because that my query ask for input via a message box it shows twice at first use. Once for the 'query' and once for the 'requery'. For me it is not so a problem but for other users of my database it should be.

Kind regards

Al
ok, you didn't mention this at all in your first post.

this sounds like you have a parameter query, and that a user value is required to run the query, which i suppose is the filter part. if you are triggering this query via a button, that suggests you have a form. why not put a textbox on the form where you can place that value into, then get your query to reference that control, instead of inputting it via a message box?
 
Hello Wiklendt

I will try this but I have no skills for coding access in vb.

I found following code on this forum. Will it do the job?

Me.Filter = "[Item] Like '*'&[Forms]![frmMasterBidItems]![txtKeyword]&'*'"
Me.FilterOn = True

Kind regards

Al
 
Hello Wiklendt

I will try this but I have no skills for coding access in vb.

I found following code on this forum. Will it do the job?

Me.Filter = "[Item] Like '*'&[Forms]![frmMasterBidItems]![txtKeyword]&'*'"
Me.FilterOn = True

Kind regards

Al

no idea - did it solve the problem in the post you got it from? never used the filter property before in VBA - why don't you try it and see? that's the best way to know if something will work, after all!
 

Users who are viewing this thread

Back
Top Bottom