remove a filter

  • Thread starter Thread starter johnlute
  • Start date Start date
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!
 
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 -
 
FYI the DoCmd.RunCommand acCmdRefresh worked but then it changewd its
mind and decided not to!
 
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 -
 
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 -
 
Back
Top