I am trying to filter a subform by clicking a buton in the main form. Here
are the form and filed names:
Key:
Main form = frmMain
Field in Main Form = POLookup (this is a text string and is the filter
criteria)
Subform = frmSub
Field in Subform = PONo (this is a text string and should be filtered
according the value in POLookup on the main form)
Here is the code for the button called POFilter:
Private Sub POFilter_Click()
Me.frmSub.Form.Filter = "me. frmSub.Form.PONo'" & Me.POLookup & "'"
Me. frmSub.Form.FilterOn = True
Me. frmSub.Form.Refresh
End Sub
Please help me correct my errors. Thank you for your help
Correction in my code:
Me.frmSub.Form.Filter = "me. frmSub.Form.PONo ='" & Me.POLookup & "'"
(I forgot to include the equal sign.)
> I am trying to filter a subform by clicking a buton in the main form. Here
> are the form and filed names:
[quoted text clipped - 15 lines]
>
> Please help me correct my errors. Thank you for your help
Maurice - 13 Jun 2007 18:55 GMT
Try this:
Me.frmSub.Form.Filter = "PONo ='" & Me.POLookup & "'"

Signature
Maurice Ausum
> Correction in my code:
> Me.frmSub.Form.Filter = "me. frmSub.Form.PONo ='" & Me.POLookup & "'"
[quoted text clipped - 19 lines]
> >
> > Please help me correct my errors. Thank you for your help
MikeP125 - 13 Jun 2007 20:06 GMT
Thank you, it worked perfectly!
> Try this:
>
[quoted text clipped - 23 lines]
> > >
> > > Please help me correct my errors. Thank you for your help