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

mafhobb

Registered User.
Local time
Today, 08:12
Joined
Feb 28, 2006
Messages
1,245
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:12
Joined
Oct 29, 2018
Messages
21,457
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, 21:12
Joined
May 7, 2009
Messages
19,230
here is a demo.
 

Attachments

  • proj.accdb
    576 KB · Views: 471

Users who are viewing this thread

Top Bottom