Sub Form read-only error

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?
 
J

John W. Vinson

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?
 
L

Lori

Yes the link was set. Referential integrity, Cascade Update and Cascade
Delete have all been set.
 

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