PC Review


Reply
Thread Tools Rate Thread

Clear Form Filter

 
 
Tara
Guest
Posts: n/a
 
      27th Aug 2008
I have a form that opens via a command button and is filtered by EmployeeID.
I'd like to remove the filter when a selection is made from a combo box.
Once the filter is removed, I'd like to requery the form data.

Can that be done?

Thanks for any help.
 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      27th Aug 2008
Tara wrote:

>I have a form that opens via a command button and is filtered by EmployeeID.
>I'd like to remove the filter when a selection is made from a combo box.
>Once the filter is removed, I'd like to requery the form data.



Depends on what you mean by "filtered". If it's the Filter
property, Then using
Me.FilterOn = False
should both disable the filter and requery the form.


You may or may not want to clear the Filter property too.

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
Tara
Guest
Posts: n/a
 
      27th Aug 2008
Thanks for getting back to me Marshall. Actually it's filterd
programatically using
the following code:

Private Sub CmdOpfrm401kG_Click()

stDocName = "frm401kGeneral"
stLinkCriteria = "[EmployeeID]=" & Me![EmployeeID]

DoCmd.OpenForm "frm401kGeneral", , , stLinkCriteria

End Sub

I'm assuming here that your solution won't work since it's coded, but I'll
go try in case I'm not understanding you. If it doesn't work, is there
another way to approach this?

Thanks for any additional advice!


"Marshall Barton" wrote:

> Tara wrote:
>
> >I have a form that opens via a command button and is filtered by EmployeeID.
> >I'd like to remove the filter when a selection is made from a combo box.
> >Once the filter is removed, I'd like to requery the form data.

>
>
> Depends on what you mean by "filtered". If it's the Filter
> property, Then using
> Me.FilterOn = False
> should both disable the filter and requery the form.
>
>
> You may or may not want to clear the Filter property too.
>
> --
> Marsh
> MVP [MS Access]
>

 
Reply With Quote
 
fredg
Guest
Posts: n/a
 
      27th Aug 2008
On Wed, 27 Aug 2008 13:04:11 -0700, Tara wrote:

> Thanks for getting back to me Marshall. Actually it's filterd
> programatically using
> the following code:
>
> Private Sub CmdOpfrm401kG_Click()
>
> stDocName = "frm401kGeneral"
> stLinkCriteria = "[EmployeeID]=" & Me![EmployeeID]
>
> DoCmd.OpenForm "frm401kGeneral", , , stLinkCriteria
>
> End Sub
>
> I'm assuming here that your solution won't work since it's coded, but I'll
> go try in case I'm not understanding you. If it doesn't work, is there
> another way to approach this?
>
> Thanks for any additional advice!
>
> "Marshall Barton" wrote:
>
>> Tara wrote:
>>
>>>I have a form that opens via a command button and is filtered by EmployeeID.
>>>I'd like to remove the filter when a selection is made from a combo box.
>>>Once the filter is removed, I'd like to requery the form data.

>>
>> Depends on what you mean by "filtered". If it's the Filter
>> property, Then using
>> Me.FilterOn = False
>> should both disable the filter and requery the form.
>>
>> You may or may not want to clear the Filter property too.
>>
>> --
>> Marsh
>> MVP [MS Access]
>>


You're not being very clear (to me anyway) as to what you wish to do.
When you are opening the form using DoCmd.OpenForm the form opens
filtered by your EmployeeID field. If you look at the newly opened
form you will see the "Funnel" tool button is down.
To remove the filter, you can either click on that funnel (raising
it), or right-click on the form and select Remove Filter/Sort, or code
your Combo Box AfterUpdate event
Me.FilterOn = False.
Any of those will show all the records again.
Now for my confusion. You haven't said what it is you want done after
selecting something from the combo box (other than requery which, if
you remove the filter, is done automatically).
Show all the records (do the above), or re-filter on a new value? If
re-filter, filter on what? You don't say.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
clear filter on open of form deb Microsoft Access Forms 1 15th May 2008 08:33 AM
Using Macro to Open Filter by form, clear grid, then run filter Victoria@DIG Microsoft Access Macros 0 20th Apr 2008 12:46 AM
Clear Filter on closing a form =?Utf-8?B?RnJhbmsgU2l0dW1vcmFuZw==?= Microsoft Access Form Coding 3 18th Jul 2007 09:51 PM
Filter by Form "Clear" button =?Utf-8?B?TWlrZQ==?= Microsoft Access 4 25th May 2005 02:49 AM
Need to clear controls of Filter form Jan Il Microsoft Access Forms 2 28th Nov 2004 02:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:32 PM.