filter not working

A

Allen_N

I am applying a filter to a subform (object name = subfrmKitComps) based on a
field in the current record of another subform:

Me.Parent.subfrmKitComps.Form.Filter = "KitItem = '" & StrCurrentKit & "'"

where StrCurrentKit was obtained from the Current event of the other subform.

Unfortunately, subfrmKitComps still shows all records; it does not exclude
those records with values in the KitItem field not equal to StrCurrentKit.

What am I doing wrong?

Thanks!
 
A

Allen_N

Sorry, Gang; it's OK. I had neglected to set the FilterOn property to True.
(IHMHIS !)
 
D

Daniel

Allen,

I beleive the issue is with the fact that you do not apply the filter. Your
code defines a filter but you are not actually applying it.

Something like

Me.Filter = "Country = 'USA'" 'Define filter
Me.FilterOn = True 'Apply the filter (or remove it if
= False)

Look up filter in the help to get examples.

Hope this help,

Daniel
 
Top