problem adding record to subform

  • Thread starter Thread starter Jim Williams
  • Start date Start date
J

Jim Williams

I have a form with two related subforms. I followed a
suggestion to use a clever trick to relate these forms: I
put an unbound countrol in the main form that points to
the current record in subform1. Then the LinkMasterFields
property for subform2 points to that control. It works
great: every time I switch records in subform1, the
correct related records show up in subform2.

But the catch is this: I cannot add a new record to
subform2. Usually when I have a subform, if I add a
record, it generates a new record in with the appropriate
value in the field specified by LinkChildFields. I can do
this with subform1. All the settings are the same for
subform2, but when I click to create a new record it just
flashes and takes me back to the existing record. If, as
a test, I change the LinkMasterFields property to another
arbitrary field in the main form (then of course I have
bizarre data show up, but) I can add records. This
suggests to me that all my form properties correct, there
is just something about linking to the unbound field
causing the problem.

I can think of no logical reason why this would be a
problem. Seems like the LinkMasterField would just pass
along a value for the subform to match Nor have a found
in info on the net. Anyone who is familiar with this
unbound control trick seen this problem? Any thoughts?

I can give details on the fields if that will help. But
the essentials are this: all the forms and subforms are
bound to tables, no queries. Table for Main Form is
related to subform1's table as one to many. Subform1's
table to related to Subform2's as one to many. Using
Access 2002 with an MDB file.
 
Check the properties of the linked field to see if duplicates are allowed.
It could be as simple as that since you said linking to other fields will
allow adding records.

Kelvin Lu
 
Back
Top