Linking forms

  • Thread starter Thread starter Tara
  • Start date Start date
T

Tara

Is there a way to link regular forms in the same way
subforms are linked to a main form? I'm not happy with
the look of a subform (I can't seem to get it formatted
the way I'd like) so I'd like to use regular forms
instead. The forms I'd like to use would all need to use
the field FamilyID to link to each other.

Thanks for any help!
Tara
 
Yes, just base the "sub form" on a query that has FamilyID =
Forms!MainForm!FamilyID

You will also need to add OnCurrent code to the "MainForm" to requery the
"Subforms" when you move records, and possibly some code on the "subform" to
set the FamilyID to be that on the "MainForm"
 
JohnFol said:
Yes, just base the "sub form" on a query that has FamilyID =
Forms!MainForm!FamilyID

You will also need to add OnCurrent code to the "MainForm" to requery
the "Subforms" when you move records, and possibly some code on the
"subform" to set the FamilyID to be that on the "MainForm"

That will mimic the behavior of a subform as far as showing existing records
is concerned, but it will not automatically carry over the linked field
values for new records like an embedded subform does. For that you would
also have to use references to the parent form as the DefaultValue property
of the linking fields.
 
I agree, hence the comment:
"some code on the "subform" to set the FamilyID to be that on the "MainForm"
"
 
Back
Top