Subform from a subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form (Databases) with a subform (Groups Subform). I would like to
put another subform, (Hospitals Subform), on the (Databases) form that links
to the (Groups Subform). Every time I try to create the (Hostpitals Subform)
with the wizard it wants to link to the (Databases) form. Can anyone
instruct me on how to do this? The relating field names for the two subforms
are [GroupID] and [GroupName].
 
Hi Ryan,

You need to nest the second subform in the first - it's a parent/child
relationship, not a peer relationship. Perhaps you can redesign the first
subform in such a way that it will still be aesthetically pleasing?
 
I tried putting the 2nd subform in the first, but it doesnt show up in
datasheet veiw. I even tried to copy the 2nd subform from the first into the
main form and that didnt work either. Im not sure what you mean by
Aesthetically pleasing?

SusanV said:
Hi Ryan,

You need to nest the second subform in the first - it's a parent/child
relationship, not a peer relationship. Perhaps you can redesign the first
subform in such a way that it will still be aesthetically pleasing?
--
hth,
SusanV


Ryan said:
I have a form (Databases) with a subform (Groups Subform). I would like to
put another subform, (Hospitals Subform), on the (Databases) form that
links
to the (Groups Subform). Every time I try to create the (Hostpitals
Subform)
with the wizard it wants to link to the (Databases) form. Can anyone
instruct me on how to do this? The relating field names for the two
subforms
are [GroupID] and [GroupName].
 
Which one is in datasheet view? The Groups or the Hospitals? (If I have this
clear in my head, one group can have many hospitals)

Ryan said:
I tried putting the 2nd subform in the first, but it doesnt show up in
datasheet veiw. I even tried to copy the 2nd subform from the first into
the
main form and that didnt work either. Im not sure what you mean by
Aesthetically pleasing?

SusanV said:
Hi Ryan,

You need to nest the second subform in the first - it's a parent/child
relationship, not a peer relationship. Perhaps you can redesign the first
subform in such a way that it will still be aesthetically pleasing?
--
hth,
SusanV


Ryan said:
I have a form (Databases) with a subform (Groups Subform). I would like
to
put another subform, (Hospitals Subform), on the (Databases) form that
links
to the (Groups Subform). Every time I try to create the (Hostpitals
Subform)
with the wizard it wants to link to the (Databases) form. Can anyone
instruct me on how to do this? The relating field names for the two
subforms
are [GroupID] and [GroupName].
 
That is correct, one group can have many hospitals. On the database form the
groups subform is in datasheet veiw, as all subforms are, so when I put the
hospitals subform on the groups subform its not viewable on the database form.

SusanV said:
Which one is in datasheet view? The Groups or the Hospitals? (If I have this
clear in my head, one group can have many hospitals)

Ryan said:
I tried putting the 2nd subform in the first, but it doesnt show up in
datasheet veiw. I even tried to copy the 2nd subform from the first into
the
main form and that didnt work either. Im not sure what you mean by
Aesthetically pleasing?

SusanV said:
Hi Ryan,

You need to nest the second subform in the first - it's a parent/child
relationship, not a peer relationship. Perhaps you can redesign the first
subform in such a way that it will still be aesthetically pleasing?
--
hth,
SusanV


I have a form (Databases) with a subform (Groups Subform). I would like
to
put another subform, (Hospitals Subform), on the (Databases) form that
links
to the (Groups Subform). Every time I try to create the (Hostpitals
Subform)
with the wizard it wants to link to the (Databases) form. Can anyone
instruct me on how to do this? The relating field names for the two
subforms
are [GroupID] and [GroupName].
 
Gotcha - not going to fit properly no matter which way you go with the
Groups as either Datasheet or continuous forms. However, perhaps you can use
the double-click event of one of the fields of the Groups subform to open a
new form, filtered to show only the relative records - unless you want to do
some major design changes this is probably the easiest way to get to where
you need to be...

Ryan said:
That is correct, one group can have many hospitals. On the database form
the
groups subform is in datasheet veiw, as all subforms are, so when I put
the
hospitals subform on the groups subform its not viewable on the database
form.

SusanV said:
Which one is in datasheet view? The Groups or the Hospitals? (If I have
this
clear in my head, one group can have many hospitals)

Ryan said:
I tried putting the 2nd subform in the first, but it doesnt show up in
datasheet veiw. I even tried to copy the 2nd subform from the first
into
the
main form and that didnt work either. Im not sure what you mean by
Aesthetically pleasing?

:

Hi Ryan,

You need to nest the second subform in the first - it's a parent/child
relationship, not a peer relationship. Perhaps you can redesign the
first
subform in such a way that it will still be aesthetically pleasing?
--
hth,
SusanV


I have a form (Databases) with a subform (Groups Subform). I would
like
to
put another subform, (Hospitals Subform), on the (Databases) form
that
links
to the (Groups Subform). Every time I try to create the (Hostpitals
Subform)
with the wizard it wants to link to the (Databases) form. Can
anyone
instruct me on how to do this? The relating field names for the two
subforms
are [GroupID] and [GroupName].
 
gday

I have done this same idea.
You have to link the second subfrm ie Hospitals to the items displayed in
the Groups subform using the normal form reference notation solution shown
below...

what u are after is:-
Databases -< GroupsSubfrm -< HospitalsSubfrm
instead of :-
+< GroupsSubfrm
Databases |
+< HospitalsSubfrm

the later is the default for subfrms on the same form.

Solution:

Place a text control on the main form (Databases) and make it invisible and
call it say txtGroupID
Set its source to :- =GroupsSubfrm.Form!GroupID

GroupsSubfrm:-
LinkChildFields: GroupID
LinkMasterFields: GroupID

HospitalsSubfrm:-
LinkChildFields: GroupID
LinkMasterFields: txtGroupID

so as you select each item in the Groups form the Hospitals items should
change to match!

Hope this helps...

Cheers
Jeff
 
Thank you very much Jeff, that is exactly what I wanted to happen. Works
like a charm now.

jeff said:
gday

I have done this same idea.
You have to link the second subfrm ie Hospitals to the items displayed in
the Groups subform using the normal form reference notation solution shown
below...

what u are after is:-
Databases -< GroupsSubfrm -< HospitalsSubfrm
instead of :-
+< GroupsSubfrm
Databases |
+< HospitalsSubfrm

the later is the default for subfrms on the same form.

Solution:

Place a text control on the main form (Databases) and make it invisible and
call it say txtGroupID
Set its source to :- =GroupsSubfrm.Form!GroupID

GroupsSubfrm:-
LinkChildFields: GroupID
LinkMasterFields: GroupID

HospitalsSubfrm:-
LinkChildFields: GroupID
LinkMasterFields: txtGroupID

so as you select each item in the Groups form the Hospitals items should
change to match!

Hope this helps...

Cheers
Jeff


Ryan said:
I have a form (Databases) with a subform (Groups Subform). I would like to
put another subform, (Hospitals Subform), on the (Databases) form that
links
to the (Groups Subform). Every time I try to create the (Hostpitals
Subform)
with the wizard it wants to link to the (Databases) form. Can anyone
instruct me on how to do this? The relating field names for the two
subforms
are [GroupID] and [GroupName].
 
VERY nice! Thanks Jeff!

Ryan said:
Thank you very much Jeff, that is exactly what I wanted to happen. Works
like a charm now.

jeff said:
gday

I have done this same idea.
You have to link the second subfrm ie Hospitals to the items displayed in
the Groups subform using the normal form reference notation solution
shown
below...

what u are after is:-
Databases -< GroupsSubfrm -< HospitalsSubfrm
instead of :-
+< GroupsSubfrm
Databases |
+< HospitalsSubfrm

the later is the default for subfrms on the same form.

Solution:

Place a text control on the main form (Databases) and make it invisible
and
call it say txtGroupID
Set its source to :- =GroupsSubfrm.Form!GroupID

GroupsSubfrm:-
LinkChildFields: GroupID
LinkMasterFields: GroupID

HospitalsSubfrm:-
LinkChildFields: GroupID
LinkMasterFields: txtGroupID

so as you select each item in the Groups form the Hospitals items should
change to match!

Hope this helps...

Cheers
Jeff


Ryan said:
I have a form (Databases) with a subform (Groups Subform). I would like
to
put another subform, (Hospitals Subform), on the (Databases) form that
links
to the (Groups Subform). Every time I try to create the (Hostpitals
Subform)
with the wizard it wants to link to the (Databases) form. Can anyone
instruct me on how to do this? The relating field names for the two
subforms
are [GroupID] and [GroupName].
 
Hi Jeff,
I tried this, by putting the equivalent of the text box linking to a data
field on the subform in your example on my main form. When I try to link to
that field, it is not in the DROP DOWN list in the SUBFORM FIELD LINKER.

Any ideas why?

--
David


jeff said:
gday

I have done this same idea.
You have to link the second subfrm ie Hospitals to the items displayed in
the Groups subform using the normal form reference notation solution shown
below...

what u are after is:-
Databases -< GroupsSubfrm -< HospitalsSubfrm
instead of :-
+< GroupsSubfrm
Databases |
+< HospitalsSubfrm

the later is the default for subfrms on the same form.

Solution:

Place a text control on the main form (Databases) and make it invisible and
call it say txtGroupID
Set its source to :- =GroupsSubfrm.Form!GroupID

GroupsSubfrm:-
LinkChildFields: GroupID
LinkMasterFields: GroupID

HospitalsSubfrm:-
LinkChildFields: GroupID
LinkMasterFields: txtGroupID

so as you select each item in the Groups form the Hospitals items should
change to match!

Hope this helps...

Cheers
Jeff


Ryan said:
I have a form (Databases) with a subform (Groups Subform). I would like to
put another subform, (Hospitals Subform), on the (Databases) form that
links
to the (Groups Subform). Every time I try to create the (Hostpitals
Subform)
with the wizard it wants to link to the (Databases) form. Can anyone
instruct me on how to do this? The relating field names for the two
subforms
are [GroupID] and [GroupName].
 
Back
Top