From: johnlute on 20 Dec 2009 09:56 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!
From: Arvin Meyer [MVP] on 20 Dec 2009 10:14 Try: DoCmd.RunCommand acCmdRemoveAllFilters -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "johnlute" <jlute(a)marzetti.com> wrote in message news:5e51f764-728c-47e1-bb04-db247e2be732(a)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!
From: johnlute on 20 Dec 2009 13:39 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! On Dec 20, 10:14 am, "Arvin Meyer [MVP]" <arv...(a)mvps.invalid> wrote: > Try: > > DoCmd.RunCommand acCmdRemoveAllFilters > -- > Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com > > "johnlute" <jl...(a)marzetti.com> wrote in message > > news:5e51f764-728c-47e1-bb04-db247e2be732(a)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 -
From: johnlute on 20 Dec 2009 14:52 FYI the DoCmd.RunCommand acCmdRefresh worked but then it changewd its mind and decided not to!
From: Arvin Meyer [MVP] on 21 Dec 2009 22:06
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 "johnlute" <jlute(a)marzetti.com> wrote in message news:74468105-5310-4efc-b493-9f514e13ee35(a)d10g2000yqh.googlegroups.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! On Dec 20, 10:14 am, "Arvin Meyer [MVP]" <arv...(a)mvps.invalid> wrote: > Try: > > DoCmd.RunCommand acCmdRemoveAllFilters > -- > Arvin Meyer, MCP, > MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com > > "johnlute" <jl...(a)marzetti.com> wrote in message > > news:5e51f764-728c-47e1-bb04-db247e2be732(a)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 - |