Sorry I do not understand what you are trying to tell me regarding linking
additional subforms.
I have used your idea from your ordinal reply and it looking good. In
hindsight I should have originally asked how I would go about linking not
only risk, PMC but a Task and a progress subforms as well on the Hazard
master form.
Hazard table
PK= hazardid
Risk table
PK = riskid
FK = Hazardid
PMC table
PK = pmcid
FK = riskid
Task table
PK = taskid
FK = pmcid
Task table
PK = progressid
FK = taskid
Just thought I would keep it simple and I would understand the issue better
then I do. Hopefully when I read your reply I will be kicking myself.
Ok, you have the Risk subform linked to the Hazard main form
by setting the risk subform control's:
LinkMaster hazardid (text box/field in Hazard form)
LinkChild Hazardid (field in Risk table)
Then, you coordinated the Risk and PMC subforms by adding a
text box named Link to the main form and added a line of
code to the Rixk form's Current event
Parent.Link = Me.riskid
and setting the PMC subform control's:
LinkMaster Link (text box on Hazard form)
LinkChild riskid (field in PMC table)
To coordinate the Task subform with the PMC subform, do the
same kind of thing. Add another text box (named LinkPMC) to
the main form and use a line of code in the PMC form's
Current event:
Parent.LinkPMC = Me.riskid
and setting the Task subform control's:
LinkMaster LinkPMC (text box on Hazard form)
LinkChild pmcid (field in Task table)
Similarly, the Progress subform can be coordinated with the
Task subform. Add another text box (named LinkTask) to the
main form and use a line of code in the Task form's Current
event:
Parent.LinkTask = Me.taskid
and setting the Progress subform control's:
LinkMaster LinkTask (text box on Hazard form)
LinkChild taskid (field in Progress table)
The idea of the pop-up form is just an idea at the moment, as I am thinking
that I may have a need to store comments for example related to information
being stored in the risk subform. I could have this field contained in my
risk subform but as it will only be needed as and when, I would like to
have this field displayed on a separate form triggered by a command button.
So I can keep the size of the overall form down. At this stage I would say
the comment field would be part of the risk table.
The other issue I had difficulties getting my head around is when one needs
to replace the functionality of the risk and PMC subforms with a popup form
triggered by a command buttons from the main form . Again should I need to
have more space on my mater form.
This is a different problem that I suggest should be put off
until it becomes necessary. The general idea is to open the
related forms using the OpenForm method's WhereCondition
argument. However if these other forms are already open,
then you would need to use their Filter property (has some
problems) or reconstruct their record source query to limit
them to the related records. With so many related forms,
this could get messy and, IMO, asking users to interact with
a lot of open forms can be confusing. I think I would
prefer to use a Tab control on the main form with the
subform's on different pages.