Sub Form read-only error

  • Thread starter Thread starter Lori
  • Start date Start date
L

Lori

I have two tables I am trying to combine on one form...

Table CONTRACTORS
Field Names:
Name (txt) (PK)
Employer (txt)

Table KEY ASSIGNMENT
Field Names:
Key (txt)
Name (txt)
Auto Number (PK)

CONTRACTORS.Name has a one to many relationship with KEY ASSIGNMENT.Name

I'm placing the CONTRACTORS table as the main table on my form and the KEY
ASSIGNMENT table as the sub form in datasheet default view. In the
properties of my sub form I have AllowEdits, AllowDeletions and
AllowAdditions all set to yes but everytime I tab or click into the Key field
I get the following error...

"This property is read-only and can't be set."

Once I close the error window I can then type information into my sub form.
The data is recorded in the KEY ASSIGNMENT table with the Name field blank.

Any ideas on what I can do to fix this?
 
I have two tables I am trying to combine on one form...

Table CONTRACTORS
Field Names:
Name (txt) (PK)
Employer (txt)

Table KEY ASSIGNMENT
Field Names:
Key (txt)
Name (txt)
Auto Number (PK)

Are you trying to copy the name from CONTRACTORS into KEY ASSIGNMENT? if so,
don't! Names are *VERY* bad choices for a primary key; a PK must be unique and
stable, and names are neither. Also, what are the Master and Child Link Fields
of your subform? And how are you assigning the "Key" value?
 
Yes the link was set. Referential integrity, Cascade Update and Cascade
Delete have all been set.
 
Back
Top