The primary key for Customer tbl is the ID. I have no primary key in the
tlbSurveys? I did not enforce Referential Integrity in the join.....could
that be it?
i didn't ask about a primary key in tblSurveys, hon. (yes, i would add a
primary key field - probably Autonumber - to tblSurveys, but it doesn't
impact the link between the two tables).
did you add the ID field (tblCustomers' primary key field) to tblSurveys as
a *foreign key*?
(note that the foreign key field does *not* have to have the same name, but
it must be the same data type - or if ID is an Autonumber, then the foreign
key field must have a Long Integer data type.)
and did you then link the two tables on those matching key fields, FROM
tblCustomers TO tblSurveys?
if you did that correctly - then, yes, you should enforce referential
integrity in the join, in the Relationships window.
having done the above (and borrowing from Rick's advice):
make sure that the main form is bound to tblCustomers (or a query built from
same).
make sure that the subform is bound to tblSurveys (or a query built from
same).
in the main form design view, select the subform control and set the
LinkMasterFields property to ID, and the LinkChildFields property to the
name of the *foreign key* field in tblSurveys.
The subform is embedded but I have it invisible and access it thru a command
button. Yes the linked fields are the Master and Child links. I'm not sure
if this is the appropriate way to approach the subform but it looks "cleaner"
going thru the command rather than having it visible. Thanks again.
don't know what you mean by "cleaner". when the mainform/subform setup is
done correctly, the subform will *always* show only those records that are
related to the current mainform record. no coding or additional steps are
needed. suggest you review the command button code to make sure it's not
undermining the correct mainform/subform setup.
hth