Form with subform

  • Thread starter Thread starter Todd
  • Start date Start date
T

Todd

I've got a main form with a subform1 that is displayed
within the main form. Using the subform wizard I could
have had it where I could click on a command button to
open the subform1 but elected not to and just have the
subform1 displayed within the main form.

Here's my question - I've got another subform2 that I'd
also like to include under the main form that I would like
to have the command button to open the subform2. I've
already got the relationship established between the main
form and subform2. How do I do this?
 
I've got a main form with a subform1 that is displayed
within the main form. Using the subform wizard I could
have had it where I could click on a command button to
open the subform1 but elected not to and just have the
subform1 displayed within the main form.

Here's my question - I've got another subform2 that I'd
also like to include under the main form that I would like
to have the command button to open the subform2. I've
already got the relationship established between the main
form and subform2. How do I do this?

I'm REALLY confused here.

You don't "open" a Subform. It's just on a form, or it's not. You can
open a *separate form* - a Popup Form it's sometimes called, but
that's a very different kind of object.

And you cannot establish "relationships" between forms. You can
establish relationships between Tables, and it's very common to use a
Form for the "one" side table of a one-to-many relationship, and a
Subform for the "many" side table. To add such a subform to a main
form, simply create a form based on the "many" side table, if you
haven't already done so, and drag it onto the main form in design
view.

John W. Vinson[MVP]
 
Sorry for the confusion, I did create the relationship
with the tables and not forms. I guess what I'm trying to
say is there is not really not enough room on the main
form to display the subform2 when I drag it to the main
form because I already have one subform1 on the main
form. How can I link the main form to this other subform2
and use a command button to open it. Does the subform2
have to actually reside on the main form?

I know when I first created the main form and subform1,
using the form wizard, I selected fields for the main form
and fields for the subform1 and during this process the
wizard gave me the option as to how I wanted to view the
data, "form with subform" or "linked forms", where using
the linked forms the subform1 would be opened with a
command button.

I hope this makes sense and if you can interpret what I've
rambled on about and help I'd appreciate it. Thanks.
 
Sorry for the confusion, I did create the relationship
with the tables and not forms. I guess what I'm trying to
say is there is not really not enough room on the main
form to display the subform2 when I drag it to the main
form because I already have one subform1 on the main
form. How can I link the main form to this other subform2
and use a command button to open it. Does the subform2
have to actually reside on the main form?

To work as a Subform (automatically keeping in synch, filling in the
ID, etc) then yes it does. I'd suggest putting a Tab Control on your
form; put one subform on the first page of the tab control, and the
other subform on the second page. You'll need to:

1. Add the Tab Control with two pages
2. Select the first subform
3. Type Ctrl-X to cut it to the clipboard
4. Select the first tab (the page should darken indicating that it's
selected); DON'T drag the subform onto the tab
5. Type Ctrl-V to paste it
6. Repeat with the second subform
I know when I first created the main form and subform1,
using the form wizard, I selected fields for the main form
and fields for the subform1 and during this process the
wizard gave me the option as to how I wanted to view the
data, "form with subform" or "linked forms", where using
the linked forms the subform1 would be opened with a
command button.

Sorry, wasn't aware this had been added to the wizard (which I rarely
use).
I hope this makes sense and if you can interpret what I've
rambled on about and help I'd appreciate it. Thanks.

Hope this helps!

John W. Vinson[MVP]
 
Back
Top