Subform says "property read-only" when editing a record

D

David

I create a form and subform using the form wizard. I previously set a
one-to-many enforced relationship between the tables. I open the table, it
displays data properly. I try to edit or add a record in the subform. Upon
the first character I type Access sends me a message box, "This property is
read-only and can't be set." After that I can go ahead and edit or add
records. However, the linked field in the subform is not getting the right
default value. It gets the name of the master form rather than the value of
the linked master field.

What's going on? Thanks in advance!
 
D

Dirk Goldgar

David said:
I create a form and subform using the form wizard. I previously set a
one-to-many enforced relationship between the tables. I open the
table, it displays data properly. I try to edit or add a record in
the subform. Upon the first character I type Access sends me a
message box, "This property is read-only and can't be set." After
that I can go ahead and edit or add records. However, the linked
field in the subform is not getting the right default value. It gets
the name of the master form rather than the value of the linked
master field.

What's going on? Thanks in advance!

What are the names of the controls and fields involved, especially the
Link Master and Child fields? One of them isn't "Name", by any chance?
 
D

David

Um, <possibly red-faced>, yes, as a matter of fact, they are *all* named
"Name", as a matter of fact. Both fields, both controls. I begin to
understand. Somewhere something is trying to refer to Something.Name and
getting a property rather than a field or control. Thank you Dirk!

The true bogosity is that when I created a separate, simplified database to
try and find out what was going on, I *still* used Name fields and controls.
Agggghh! <amused grin> Thanks again.
 
D

Dirk Goldgar

David said:
Um, <possibly red-faced>, yes, as a matter of fact, they are *all*
named "Name", as a matter of fact. Both fields, both controls. I
begin to understand. Somewhere something is trying to refer to
Something.Name and getting a property rather than a field or control.
Thank you Dirk!

The true bogosity is that when I created a separate, simplified
database to try and find out what was going on, I *still* used Name
fields and controls. Agggghh! <amused grin> Thanks again.

<chuckle> I guess you know what you have to do, then. There *are* ways
to work around the problem without renaming the fields and controls, but
unless you do that, this problem is going to come back and bite you
again.

You're welcome, and good luck!
 
D

David

Dirk Goldgar said:
<chuckle> I guess you know what you have to do, then. There *are* ways
to work around the problem without renaming the fields and controls, but
unless you do that, this problem is going to come back and bite you
again.

Yes, I suppose you mean using the [Something]![Name] syntax instead of
Something.Name. I guess I have room to gripe that an unadulterated
wizard-generated form/subform fails in this case. <snarl> But a simple
name-change will free me from this nastiness, thanks to you.

David
 
Top