remove a filter

J

johnlute

I have a combobox [cbqrytypes] that I use to filter a form
[frmPackaging]. [cbqrytypes] has this simple AfterUpdate event:
Private Sub cbqrytypes_AfterUpdate()
Me.cbProfileID.Requery
Forms![frmPackaging].Form.Refresh
Forms![frmPackaging].Form.Requery
End Sub

The Record Source for [frmPackaging] has [cbqrytypes] in it so
everything works just dandy. The challenge is clearing the filter
after opening [frmPackaging] from another form. For example, I have
other forms with double-click events that will open [frmPackaging] and
filter to the primary key value which displays in [cbProfileID]. After
this when I try to change the value in [cbqrytypes] then weird things
happen because the form's filter is already set.

I've tried Me.Filter = "" in the above AfterUpdate but that does
absolutely nothing.

Any ideas are greatly appreciated!
 
J

johnlute

Hi, Arvin. Thanks for the insight!

I tried that but I'm using Access 2003 and it didn't recognize it. In
fact, it's not in the dropdown list of options.

I gave this a try:
DoCmd.RunCommand acCmdRemoveFilterSort

No good.

I tinkered around a bit more and this did the trick:
DoCmd.RunCommand acCmdRefresh

Thanks!

Try:

DoCmd.RunCommand acCmdRemoveAllFilters
--
Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com




I have a combobox [cbqrytypes] that I use to filter a form
[frmPackaging]. [cbqrytypes] has this simple AfterUpdate event:
Private Sub cbqrytypes_AfterUpdate()
       Me.cbProfileID.Requery
       Forms![frmPackaging].Form.Refresh
       Forms![frmPackaging].Form.Requery
End Sub
The Record Source for [frmPackaging] has [cbqrytypes] in it so
everything works just dandy. The challenge is clearing the filter
after opening [frmPackaging] from another form. For example, I have
other forms with double-click events that will open [frmPackaging] and
filter to the primary key value which displays in [cbProfileID]. After
this when I try to change the value in [cbqrytypes] then weird things
happen because the form's filter is already set.
I've tried Me.Filter = "" in the above AfterUpdate but that does
absolutely nothing.
Any ideas are greatly appreciated!- Hide quoted text -

- Show quoted text -
 
J

johnlute

FYI the DoCmd.RunCommand acCmdRefresh worked but then it changewd its
mind and decided not to!
 
A

Arvin Meyer [MVP]

Sorry acCmdRemoveAllFilters must be an Access 2007 command.
acCmdRemoveFilterSort should work. Where are you using it? It should be on
the form that's been filtered.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Hi, Arvin. Thanks for the insight!

I tried that but I'm using Access 2003 and it didn't recognize it. In
fact, it's not in the dropdown list of options.

I gave this a try:
DoCmd.RunCommand acCmdRemoveFilterSort

No good.

I tinkered around a bit more and this did the trick:
DoCmd.RunCommand acCmdRefresh

Thanks!

Try:

DoCmd.RunCommand acCmdRemoveAllFilters
--
Arvin Meyer, MCP,
MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com




I have a combobox [cbqrytypes] that I use to filter a form
[frmPackaging]. [cbqrytypes] has this simple AfterUpdate event:
Private Sub cbqrytypes_AfterUpdate()
Me.cbProfileID.Requery
Forms![frmPackaging].Form.Refresh
Forms![frmPackaging].Form.Requery
End Sub
The Record Source for [frmPackaging] has [cbqrytypes] in it so
everything works just dandy. The challenge is clearing the filter
after opening [frmPackaging] from another form. For example, I have
other forms with double-click events that will open [frmPackaging] and
filter to the primary key value which displays in [cbProfileID]. After
this when I try to change the value in [cbqrytypes] then weird things
happen because the form's filter is already set.
I've tried Me.Filter = "" in the above AfterUpdate but that does
absolutely nothing.
Any ideas are greatly appreciated!- Hide quoted text -

- Show quoted text -
 
J

johnlute

Hi, Arvin.

Thanks for the response. I should've posted using 2003 initially -
sorry about that. I thought I resolved this so many times only to find
that I overlooked something. After MUCH tinkering I re-posted the
problem with what I thought was more clarity but it's just not working
out:
http://groups.google.com/group/micr...coding/browse_thread/thread/d0aa7031098338ea#

I'm planning a response to Rob however I'm unable to do any design
work today. More late nights ahead...

Sorry acCmdRemoveAllFilters must be an Access 2007 command.
acCmdRemoveFilterSort should work. Where are you using it? It should be on
the form that's been filtered.
--
Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com


Hi, Arvin. Thanks for the insight!

I tried that but I'm using Access 2003 and it didn't recognize it. In
fact, it's not in the dropdown list of options.

I gave this a try:
DoCmd.RunCommand acCmdRemoveFilterSort

No good.

I tinkered around a bit more and this did the trick:
DoCmd.RunCommand acCmdRefresh

Thanks!

DoCmd.RunCommand acCmdRemoveAllFilters
news:5e51f764-728c-47e1-bb04-db247e2be732@s20g2000yqd.googlegroups.com...
I have a combobox [cbqrytypes] that I use to filter a form
[frmPackaging]. [cbqrytypes] has this simple AfterUpdate event:
Private Sub cbqrytypes_AfterUpdate()
Me.cbProfileID.Requery
Forms![frmPackaging].Form.Refresh
Forms![frmPackaging].Form.Requery
End Sub
The Record Source for [frmPackaging] has [cbqrytypes] in it so
everything works just dandy. The challenge is clearing the filter
after opening [frmPackaging] from another form. For example, I have
other forms with double-click events that will open [frmPackaging] and
filter to the primary key value which displays in [cbProfileID]. After
this when I try to change the value in [cbqrytypes] then weird things
happen because the form's filter is already set.
I've tried Me.Filter = "" in the above AfterUpdate but that does
absolutely nothing.
Any ideas are greatly appreciated!- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

filter frustration 3
filtering a form 7
filtering a form re-visited 12
lost focus...? 3
Reseting Filter 4
removing a filter 1
Filter 4
Need combo box to refresh when moving to new record 2017 1

Top