The tab page does not come into the name.
Open the main form in design view.
Right-click the edge of the subform control, and choose Properties.
What is the Name property (first item on the Other tab)?
--
I see nothing that would indicate the control name (the form)is anything
other than the form name. Does make any difference that the subform is
on
a
page 7 of a tabbed form (the main form)?
Ed
:
Are you sure that the name of the subform control is frmTask?
Depending
on
how you added the subform to the parent form, the name of the control
may
be
different than the name of the form being used as a subform. It's the
name
of the control you need to use.
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
I get a "method or data member not found" error. I'm assuming the
first
line
literally should be
With Me.frmTask.Form
Is that correct?
:
Assign the string to the Filter property of the subform, and toggle
FilterOn
as well:
With Me.[NameOfYourSubformHere].Form
.Filter = "closed=no"
.FilterOn = True
End With
If you apply a filter to both the main form and the subform, Access
can
get
confused. Details in:
Incorrect filtering of forms and reports
at:
http://allenbrowne.com/bug-02.html
This bug has been fixed in Access 2007, but still applies to Access
95,
97,
2000, 2002, and 2003.
message
I'm trying to apply the following via a command button on a
subform.
When
I
click the command button when the form is not opened as a subform
(F11
and
opening the form directly) all works fine. However, when I open
my
main
form
(frmTabOpportunity) which contains my subform (frmTask) the
command
button
on
the subform no longer works.
DoCmd.ApplyFilter , "closed=no"