K
Kurt
frmHospital has three subforms: fsubDoctors, fsubNurses, and
fsubPersonDetails.
fsubDoctors & fsubNurses (both in continuous view) list people from
tblPeople. They have the same SQL record source except one shows
people whose Role = "Doctor"; the other shows people whose Role =
"Nurse."
When the user clicks on a name in either subform, I'd like that
person's full record to appear in the 3rd subform, fsubPersonDetails.
To do this I've added a hidden text box on frmHospital (txtPersonID)
which I populate with this code in the OnCurrent event of the two
continuous subforms:
Me.Parent!txtPersonID = Me![PersonID]
fsubDetail is linked to frmHospital with PersonID (Child Field) and
txtPersonID (MasterField).
When a hospital has both doctors and nurses, only one of the subforms
updates the txtPersonID when I select a name. Clicking a name from the
other subform (when a person in the other form was already selected)
seems to have no affect. I think the OnCurrent code is competing to
populate txtPersonID.
I can move code out of the OnCurrent event and put it in the click
event of a control in the continuous subform, but of course this means
fsubPersonDetails won't automatically refresh when the user changes
records on the main form (frmHospital).
Any suggestions?
fsubPersonDetails.
fsubDoctors & fsubNurses (both in continuous view) list people from
tblPeople. They have the same SQL record source except one shows
people whose Role = "Doctor"; the other shows people whose Role =
"Nurse."
When the user clicks on a name in either subform, I'd like that
person's full record to appear in the 3rd subform, fsubPersonDetails.
To do this I've added a hidden text box on frmHospital (txtPersonID)
which I populate with this code in the OnCurrent event of the two
continuous subforms:
Me.Parent!txtPersonID = Me![PersonID]
fsubDetail is linked to frmHospital with PersonID (Child Field) and
txtPersonID (MasterField).
When a hospital has both doctors and nurses, only one of the subforms
updates the txtPersonID when I select a name. Clicking a name from the
other subform (when a person in the other form was already selected)
seems to have no affect. I think the OnCurrent code is competing to
populate txtPersonID.
I can move code out of the OnCurrent event and put it in the click
event of a control in the continuous subform, but of course this means
fsubPersonDetails won't automatically refresh when the user changes
records on the main form (frmHospital).
Any suggestions?