If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Linking subforms
I have two subforms I'd like to link (main form sets up a meeting, sbfA
selects cases to discuss, then sbfB records details for each case). I've got the main form and the first subform working; but I can't get the first and second subforms to link. I've added a text box to the main form and set its control source as the primary key in sbfA, intending then to have sbfB's foreign key link to the text box; sort of a cascading link. I think it's a proper approach. Problem is, I can't get the master links dialogue to pick up the text box as part of the main form. Even when I go back and insert the second subform with a wizard, it doesn't acknowledge the textbox. Any ideas what's wrong, or alternate approaches? Before you suggest it: I'd much prefer NOT to nest sbfB within sbfA. Thanks. |
#2
|
|||
|
|||
Linking subforms
There is an example in one of the Northwind sample database Orders forms.
Add a textbox on the main form set it = to: =Forms!MainFormName!SubformAControlName.Form!Prima ryKey IOW, use the value of the primary key of the subtable (not the foreign key which is what is linked to the mainform). In the LinkMaster/Child fields of the second subform, set the links to the textbox on the main form. Now as you change records in subformA, you will stay sync'd up to subformB. -- Arvin Meyer, MCP, MVP Free MS-Access downloads: http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Pret" wrote in message ... I have two subforms I'd like to link (main form sets up a meeting, sbfA selects cases to discuss, then sbfB records details for each case). I've got the main form and the first subform working; but I can't get the first and second subforms to link. I've added a text box to the main form and set its control source as the primary key in sbfA, intending then to have sbfB's foreign key link to the text box; sort of a cascading link. I think it's a proper approach. Problem is, I can't get the master links dialogue to pick up the text box as part of the main form. Even when I go back and insert the second subform with a wizard, it doesn't acknowledge the textbox. Any ideas what's wrong, or alternate approaches? Before you suggest it: I'd much prefer NOT to nest sbfB within sbfA. Thanks. |
Thread Tools | |
Display Modes | |
|
|