Form multiple subforms?

T

tecas

I have a issue where one table Employee Shift has two depentant tables
Downtime and Scrap. I have created a form subform with Employee Shift
and Downtime. I also want to include an additional subform of Scrap.
Is it possible to include 2 subforms on a single form? If so, does
anyone have an example?
 
A

Albert D. Kallal

You can place as many sub-forms as you want.

the question is your relation you trying to display

For example

Employee shift ----> phone numbers
----> DownTime
----> scrap
----> name of children


The above has the employee shift as the "parent" table, and then each of the
other tables are related back to the employee shift.

however, you might have the following:

Employee shift ----> Downtime---> scrap
----> name of children
etc.

In the above, each employee shift has a downtime record, and each downtime
record can have many scrap records.

So, the first example is easy, as you can just create a sub-form, and drop
in as many sub-forms to display related data.

For the 2nd example, you have to use a sub-form within a sub -form. And, you
can't use contuse forms to display the data.

What I do in these cases is actually drop in two sub-forms in to the form
(but they are NOT nested).


There is a screen shot of this type of layout in the following:

http://www.members.shaw.ca/AlbertKallal/Articles/Grid.htm

Look at the very last screen shot. You have a main record, then on left side
you have many, and for each of the many, you have many on the right side.

In the link child/master settings for child 1, you place:

linkChildFields main_id (whatever is the name of the field in
this sub-form that is used to relate back to the parent table)
LinkMasterFields [ID]

In the link child/master settings for child 2 form you place

linkChildFields main_id (whatever is the name of the field in
this sub-form that is used to relate back to the parent table)
LinkMasterFields [child1].[form].[ID] ("masterForm" is the name of
the contorl you used to hold the master form).

You likely have to put a requery command in the left side continues form's
"on current" event to make the right side update (but, try it as above..it
might work without having to even write one line of code).
 
J

John W. Vinson

I have a issue where one table Employee Shift has two depentant tables
Downtime and Scrap. I have created a form subform with Employee Shift
and Downtime. I also want to include an additional subform of Scrap.
Is it possible to include 2 subforms on a single form? If so, does
anyone have an example?

I've used as many as twelve. (The form was VERY slow to open).

Just put a second subform on the form. Set its Master and Child Link Fields
appropriately.

How are the [Employee Shift] table and the [Scrap] table related? I hope
you're not scrapping employees! <g>

John W. Vinson [MVP]
 
T

tecas

I have a issue where one table Employee Shift has two depentant tables
Downtime and Scrap. I have created aformsubformwith Employee Shift
and Downtime. I also want to include an additionalsubformof Scrap.
Is it possible to include 2 subforms on a singleform? If so, does
anyone have an example?

I've used as many as twelve. (Theformwas VERY slow to open).

Just put a secondsubformon theform. Set its Master and Child Link Fields
appropriately.

How are the [Employee Shift] table and the [Scrap] table related? I hope
you're not scrapping employees! <g>

John W. Vinson [MVP]

Thank you John and Albert. I now have two subforms on my employee
shift data form. Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Need help with a query 1
Multiple Sub Forms 3
Subform Multiple Entries 1
Multiple subforms 2
SubForms 4
Subforms 4
linking to two subforms 2
Forms and subforms 2

Top