What y wally wanted to find in his orginal post was the relevant field to use (master link field) for each of his subforms. Purpose was (unless mistaken) to be able to code an Add/insert button in the subform.
But if he also had multiple instances of the Main form (so 2 or more of the same form, with same form name in the Forms collection), each with 2 subform instances in them then he need to keep track of not only the field to use, but also which current record the corresponding main form is on for each subform. Otherwise if he is on ID 5 in Main form A and on ID 10 in Main form B his add/insert button will not know what to insert in which form even if he sorted out what which linkfield the subform used for his insert button. At least I thougt that would be a problem.
But if he knows the ID of the mainform, he can query for that entry, and like you wrote in earlier posts, VBA can be used to use same subform instead of copies of them.
In main forms open event he can set value in the subforms like a "mode" to tell the subform how it is used. For example 1 means it is subform A, and 2 means it is subform B of the main form.
Then simply using Me.Parent.Form.CurrentRecord gives the last thing needed.
Now he can build whatever code he wants for the Add/Insert button mentioned in the original post because he knows how the subform is used (ie which columns are used in link) and he knows the ID of the parent form so he can
find the values needed for an INSERT statement.
Reason I got stuck on this is that so many answers I found online for similar questions refers to the Forms collection, but that is not a good option (as far as I can tell) if you have multiple instances of the same form. They will have same form name in the Forms collection.
But maybe I misunderstood the problem. I am not very good at access, I try to solve most of my problems in VBA which I have more experience in. Not sure if this was clearer. More detailed at least
