JimP said:
A form has a subform on it. Is it possible to
not open the subform at the time the main
form opens, and open the subform when a
button on the main form is pressed?
Not to be picky, but just for the record, there is no Access Object called a
Subform -- there is a Subform Control, usable on a Form, in which you can
embed a Form or Datasheet View. You do not "Open" Controls, and, when
displayed in a Subform Control, the embedded form is not "Open" (it will not
be a member of the "Forms" collection), but is the Form propert of the
Subform Control.
What you can do is to set the Visible Property of the Subform Control so
that it shows or does not.
..easy enough to open a separate form from the button, but not sure how a
subform could be opened (some type of late binding?).
"Late binding"? That does not apply either to Controls or to Forms.
In the Click event of the Command Button,
Me!nameofyoursubformcontrol.Visible = True
So it doesn't show all the time, set the Visible property of the Subform
Control to "No" in design view.
If you'd like to be able to toggle the Visibility On and Off, you could use
Me!nameofyoursubformcontrol.Visible = Not
Me!nameofyoursubformcontrol.Visible
Larry Linson
Microsoft Office Access MVP