how to apply filter to a filter?

arage

Registered User.
Local time
Today, 20:10
Joined
Dec 30, 2000
Messages
537
So I’m filtering my form on the openEvent & the first field available is a combo box. On the afterUpdate event of the combo box I’d like to apply another filter, so will the form then return a subset of the records that were returned upon the forms openEvent (dumb question but I have to ask)?
 
You can use the following in the AfterUpdate event of the combo box...

me.filter = me.filter & " AND " 'Enter your new filter criteria here....

Hope this helps..

Doug
 
I get a data type mismatch with the following:
Me.Filter = Me.Filter And "PromotionType =" & cboPromotionType
Me.Filter = Me.Filter And "[NewQuery]![PromotionType] =" & Me.cboPromotionType

And that the field NewQuery in expression cannot be found:
Me.Filter = Me.Filter And [NewQuery]![PromotionType] = Me.cboPromotionType

NewQuery is a part of the forms record source.
 
You just have the sytax incorrect... Use the ampersand(&) to concatenate the new filter...

Me.Filter = Me.Filter & " And PromotionType =" & cboPromotionType

Also, if PromotionType is a string value, then you have to put tick marks(') around the variable, like so...

Me.Filter = Me.Filter & " And PromotionType ='" & cboPromotionType & "'"

Hope this solution helps you...

Doug
 
Thank you very much D-Freshie
wink.gif
that did the trick
 

Users who are viewing this thread

Back
Top Bottom