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
|