If this is the typical setup where the main form contains records and the
subform has only the matching records, it is not just a matter of applying a
filter to the subform. What you need to do is to filter the main form so it
contains only those records that have a match in the subform.
If that's what you are trying to do, see:
Filter a Form on a Field in a Subform
at:
http://allenbrowne.com/ser-28.html
If the subform has nothing in its LinkMasterFields/LinkChildFields
properties, then it is just a matter of applying a filter. You could put an
unbound text box on your form, and use its After Update event procedure to
filter the subform:
Private Sub txtFindThis_AfterUpdate()
With Me.[NameOfYourSubformControlHere].Form
If .Dirty Then
.Dirty = False
End If
If IsNull(Me.txtFindThis) Then
.FilterOn = False 'Nothing entered: show all records.
Else
.Filter = "[Subject Keyword] Like ""*" & Me.txtFindThis & "*""
.FilterOn = True
End If
End With
End Sub

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> I need to be able to find records by searching the Subject Keyword field
> (in a subform).
[quoted text clipped - 5 lines]
>
> Melbourne, VIC
Diana Tan - 12 May 2005 05:49 GMT
Hi Allen,
I was currently doing something similar as stealth...
I has put the code in successfully... But any idea how do i add in more
criteria to filter the records?
and is there any way to prevent any editing of the records in the subform?
I read an earlier post about using filters and I couldn't get it to
work.
The main form also has fields that my users will want to search: eg
title, author, journal details etc
The subform is connected to a query of TitleID & SubjectID, and which
is related to a table of subject keywords. As I catalogue a
book/journal I search the table and select appropriate subject
keywords. So that one book/journal article etc may have 1 or more
subject keywords attached to it.
The users of the database may want to search for titles based on a
keyword.
Does that provide enough information to ascertain whether filters is
the way I need to go?
thank you
------------------------------------------------
Allen Browne - 06 Jan 2004 06:14 GMT
The article at:
http://allenbrowne.com/ser-28.html
should be perfect for your needs.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> I read an earlier post about using filters and I couldn't get it to
> work.
[quoted text clipped - 13 lines]
> Does that provide enough information to ascertain whether filters is
> the way I need to go?