LinkMaster>LinkChild problem

A

Amy Blankenship

Hi, all;

I have a rather complex form with a subform that has a tabset in it. Each
tab has a different form relating to the parent subform. And each of those
subforms has more subforms doing different things. In one of the tabs on
the tabset, its subform has a form that has problems with its
LinkMaster>LinkChild relationship. For reference:

Form
-Subform 1
-Tabset
-Subform 2
-Subform 3

In Subform 3 there seems to be a problem with the LinkMaster>Child
relationship. At first, when I added content, I got a message that either
the content was too long, the form was read only, or something else I don't
recall at the moment. When I looked in the related tables, the record was
created in the child table, but its ID had not been inserted in the parent
table (the record source for Subform 2).

So I tried to repair the LinkMaster/LinkChild relationship. Clicking on the
.... next to the LinkMaster gave me a dialogue called "Subform Field Linker"
with the message "Object variable or With block variable not defined." I
tried reinserting the form and manually setting up the Master/Child
relationship and recreating Subform 2 from scratch. In the recreated
version, if you change to a new, blank record in Subform 2 after viewing a
record with a linked record in Subform 3, the blank record will still show
the record in Subform 3 even though no data has ever been created for that
new record in Subform 2 (yes, it's a 1:1 relationship, sort of).

I have verified that the LinkMaster ... button works on other subforms in
the same main form. I have also verified that the relationship is set up
properly between the tables on Subform 2 and Subform 3.

TIA;

Amy
 
T

tina

even in nested subforms, the parent/child link is straightforward when it's
hard-coded in the subform control's LinkChildFields and LinkMasterFields
properties (it can get tricky if you're trying to manipulate the links
programmatically). you should be able to simply enter the name of the
primary key field of the parent form (even though it's a subform itself) in
the LinkMasterFields property of the subform control, and enter the name of
the matching foreign key field of the subform in the LinkChildfields
property.

hth
 
A

Amy Blankenship

tina said:
even in nested subforms, the parent/child link is straightforward when
it's
hard-coded in the subform control's LinkChildFields and LinkMasterFields
properties (it can get tricky if you're trying to manipulate the links
programmatically). you should be able to simply enter the name of the
primary key field of the parent form (even though it's a subform itself)
in
the LinkMasterFields property of the subform control, and enter the name
of
the matching foreign key field of the subform in the LinkChildfields
property.

You would think so. But the dialogue won't open to allow me to do so. I
was hoping someone could tell me why so I could fix it.
 
T

tina

you don't need to use the dialog box. have you tried just typing in the
correct field names manually?

hth
 
A

Amy Blankenship

tina said:
you don't need to use the dialog box. have you tried just typing in the
correct field names manually?

The correct field names are in there already. However, clearly the records
are not being associated correctly. The fact that the dialogue does not
open properly seems to be a clue that something is very wrong with the form
or the relationship.
 
A

Amy Blankenship

Update:

I found that somehow the form had managed to create a record in the table
used as the data source for "Subform 3" with a PK of 0 in a field of type
Autonumber. This explains why new records displayed that text.

I then made the linked fields visible in Subform 2 & 3. When I deleted the 0
record and navigated to the parent record in Subform 2, the parent record
showed 0 and the child record showed {Autonumber}. When I tried to paste
into the text box bound to the memo field in Subform 3, I got this message:

"You can't assign a value to this object.
*The object may be on a control on a read-only form
*The object may be on a form open in Design view.
*The value may be too large for this field."

On clicking OK, the value actually DOES paste, but then the Autonumber value
is replaced by an ID that I know to be in use. Closing the form results in
an error message that says that the changes could not be made to the table
because they would create a duplicate in the primary key (duh).

Anyone have ANY idea what the heck is going on here?

Thanks;

Amy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top