Update a second subform from a first subform through an event on the first subform (1 Viewer)

mafhobb

Registered User.
Local time
Today, 08:57
Joined
Feb 28, 2006
Messages
1,170
I have a main form with some property info that contains one continuous subform. This subform is called "frmProjectSubform" and it contains a list of projects for that property.
Now I want to add a second continuous subform "frmProjectHistorySubform" next to the first one to show the history comments for any one selected project.
What I want to do is simply click (or doubleclick) on any project listed in subform "frmProjects" and have the subform "frmProjectHistorySubform" update to that project's history comments to read them or edit them or even enter new ones.
The table relationships are worked out through the recorsource tables (tblProperties for the main form, tblProject for the first continuous subform and tblProjectHistory for the second subform)
What needs to be done to update the data in "frmProjectHistorySubform" when I click on a project in "frmProjectSubform"?
Thanks
mafhobb
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:57
Joined
Oct 29, 2018
Messages
17,199
One technique is to use a hidden Textbox on the main to reflect the primary key of the first subform and then use it as the Link Master Field for the second subform.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:57
Joined
May 7, 2009
Messages
14,664
here is a demo.
 

Attachments

  • proj.accdb
    576 KB · Views: 137

Users who are viewing this thread

Top Bottom