Share via


Subforms in Continuous forms

Question

Monday, October 24, 2011 8:37 PM

I need to have several levels of subforms in an Access genealogy app, but Access doesn't allow subforms in a continuous form.  Any suggestions for workarounds would be appreciated.

The scenario is:

On a form, a selected person in a marriage is shown at the top.

Is a subform, all the spouses of that person (over time) are listed.

In the spouses subform, all the children for each spouse and the selected person are listed.

In the childrens subform, the spouses of each child are listed.

All replies (12)

Monday, October 24, 2011 9:17 PM ✅Answered

You can't place a subform in the Detail section of a continuous form, but you can place it in the form footer (or header) of a continuous form. As you move from record to record in the continuous form, the subform in the footer will display the related subrecords.

Another option is to arrange all subforms on the main form.

Regards, Hans Vogelaar


Sunday, October 30, 2011 4:08 PM ✅Answered

Depending on the level of details that you want to display, an hierarchical tree could display the result that you want.  You could also use an ordinary continuous form is you use multiple columns and arrange to leave the content of some of these columns as beeing blank when they are not at the beginning of a level.

You could also find on the market some pretty cool control that would be able to display your hierarchical data.  However, you are more likely to find such a  control that will work with the .NET framework instead of with Access.  At this moment, the market for .COM/ActiveX is pretty much dead. (It's also possible to use a .NET component under Access using the Interop but it's rather complicated and if you are capable of using a .NET control under Access, then you're much better to go with an entire .NET application rather than to go with some hybrid application.)

For the rest, you're right saying that Access forms and subforms are not well suited for displaying complex hierarchical data at a glance; especially when you want to display more than one (or two?) sub-levels.


Friday, November 11, 2011 1:03 AM ✅Answered

I've created an extensive genealogy database using Access 2007.  The way I handle what you're trying to do is by placing a command button next to the individual currently displayed, that when clicked, will create a pop-up window listing all of their descendants (and spouses with corresponding children) in outline format.  Each entry is clickable so, when a couple is clicked, you will be taken to their screen.

My pop-up window looks something like this (assuming you clicked the command button for John Doe):

John Doe (DOB - DOD) & Mary Smith (DOB - DOD)

   1.  Child #1 (DOB - DOD) & Spouse #1 (DOB - DOD)

        1.  Child #1 (DOB - DOD) & Spouse (DOB - DOD)

        2.  Child #2 (DOB - DOD) & Spouse (DOB - DOD)

   1.  Child #1 (DOB - DOD) & Spouse #2 (DOB - DOD)

   2.  Child #2 (DOB - DOD) & Spouse (DOB - DOD)

        1.  Child #1 (DOB - DOD) & Spouse #1 (DOB - DOD)

              1.  Child #1 (DOB - DOD)

              2.  Child #2 (DOB - DOD) & Spouse (DOB - DOD)

        2.  Child #2 (DOB - DOD)

   3.  Child #3 (DOB - DOD)

I accomplish this by creating a continuous form with one text field and put all the necessary data into a table.  Then the form displays a record for each of the lines above.  Of course, the table also has to contain appropriate information so the descendant information is displayed in the proper order and you will be taken to the proper record when a couple's field's clicked.

I hope this helps.

Michael


Sunday, October 30, 2011 2:02 PM

Hans,

That technique won't give the client the look he wants, but I don't think it can be done in Access. I'm probably going to use pop-up continuous forms to show the information.

Thanks.


Monday, October 31, 2011 1:04 PM

Thanks Sylvain, I'll investigate the both the hierarchical tree and continuous form with blank records.


Monday, November 14, 2011 1:20 AM | 1 vote

Actaully, you can easy build a many to many form and you can do this with about 2 lines of code.

You simply build the 3 grids using continues forms, or 3 forms in data sheet view.

You then create a 4 form, and drop in the above 3 forms.

In the master form (which is now a subform), in the on current event, you
place the following command to make the child forms follow this form.

me.Parent.Child1.Requery
me.Parent.Child2.Requery.

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    [MasterForm].[form].[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    [MasterForm].[form].[ID]   ("masterForm" is the name of
the contorl you used to hold the master form).

Here is a form that lets you "distribute" out finds to many accounts and is a classic accounting form that you would see in simply accounting etc. On the top is the main table (batch run), on the left are the donors and their amount, and on the right side is that amount distributed to many accounts.

So in above I did not place a sub form "nested" in a sub-form, but simply placed them side by side and the result is the same with the tiny bit of code, and in fact it LESS code then just about any system I used to display + edit + model a many to many form. So with Access not only is this a walk in the park, it also less code then most other systems.

Albert D. Kallal  (Access MVP)
Edmonton, Alberta Canada


Monday, November 14, 2011 3:39 PM

Hi mmmtbig,

In one application I solved this problem by using a unbound form with many hidden Text boxes.

During the opening of the form the Text boxes were filled with the data to display, the Visible property set to True, and the position (Top, Left, Hight, Width) of the Text box set to such value that it reflects your wanted hierarchy.
Moreover, colour of each Text box can be influenced. The Tag of each Text box holds the corresponding Person_id, so that al further information about that Person can be found.

Clicking on a Text box makes this Person the "seed" of the form. Eventually you can extend this approach to both ancestors or descendants.

 

Imb. 


Monday, November 14, 2011 7:45 PM

I ran into the problem developing a genealogy app also, in the "Immediate Family screen".

My client requested a slightly different layout (subject name and parents, all spouses of subject listed below, button to list the children from each spouse (and subject) under the spouse, and each of the spouses of each child.

Person Person's Father and Mother Birth Year & Place/Death Year & Place

Spouse 1 Spouse 1's Father and Mother Wedding Date & Place Birth Year & Place/Death Year & Place
 Child 1
 Spouse 1 of Child 1 Wedding Date & Place Birth Year & Place/Death Year & Place
 Spouse 2 of Child 1 Wedding Date & Place Birth Year & Place/Death Year & Place

 ... 

Child 2
Spouse 1 of Child 2 Wedding Date & Place Birth Year & Place/Death Year & Place
Spouse 2 of Child 2 Wedding Date & Place Birth Year & Place/Death Year & Place

... 

 

Spouse 2 Spouse 2's Father and Mother  Wedding Date & Place Birth Year & Place/Death Year & Place

Child 1
Spouse 1 of Child 1 Wedding Date & Place Birth Year & Place/Death Year & Place
Spouse 2 of Child 1 Wedding Date & Place Birth Year & Place/Death Year & Place

... 

 

 

Child 2
Spouse 1 of Child 2 Wedding Date & Place Birth Year & Place/Death Year & Place
Spouse 2 of Child 2 Wedding Date & Place Birth Year & Place/Death Year & Place

... 

Note: the editor really screwed up the text alignment above

I have used a button with a popup for each spouse and children, but it doesn't give my client the exact look he wanted.

I designed a temp table combining all the data but ran into problems implementing it due to alignment of all the text boxes.

Thanks for responding. Maybe we should discuss our projects....

 


Monday, November 14, 2011 8:12 PM | 1 vote

I agree with Albert and have used this approach for many solutions, your main form is now just a shell and subform1 is your main continous form and it drives the other subforms


Monday, November 14, 2011 9:28 PM

That works, but my client wants the people stacked in the left half of the screen. And the client is always right....


Monday, November 14, 2011 9:54 PM | 1 vote

And the client is always right....

Hi mmmtbig,

The Dutch translation is "De klant is koning" (The client is king).
But even kings are not always right.

Which is the way you want to go?

 

Imb.


Thursday, November 17, 2011 2:27 PM

Sometimes we have to "educate" the client - carefully, slowly, persuasively.

My client will review the design today where a pop-up form lists the children of the selected spouse.

Thanks for your input.