G
Guest
I have three tables A, B and C.
Table C is an intersection table for a many-to-many relationship between A
and B
A has one primary key field
B has two primary key fields
C has three foreign key fields: one to A, two to B
I have a query Q that joins B and C on the two primary key fields of B
I have a form based on A and a subform based on Q
The form and subform are linked via the primary key field of A
In the subform the first field of Q is a combo-box which is enabled and not
lock
The first field is the first of B's two primary keys
The combo-box selects a record from B and uses the AfterUpdate event
procedure to update C's second foreign key.
Here is what happens:
When I click in the combo-box and press a key, I get the error message:
"this property is read only & can't be set"
After dismissing the error message, the combo-box allows me to set the first
foreign key and then correctly updates the second foreign key in the event
procedure.
After filling in all the fields, attempting to update the record gives the
following message: "index or primary key cannot contain a null value"
This is puzzling because the foreign key to A is handled by the parent :
child relationship of form and subform and the two foreign keys to B contain
valid data.
Can someone help me understand what is going on ?
Table C is an intersection table for a many-to-many relationship between A
and B
A has one primary key field
B has two primary key fields
C has three foreign key fields: one to A, two to B
I have a query Q that joins B and C on the two primary key fields of B
I have a form based on A and a subform based on Q
The form and subform are linked via the primary key field of A
In the subform the first field of Q is a combo-box which is enabled and not
lock
The first field is the first of B's two primary keys
The combo-box selects a record from B and uses the AfterUpdate event
procedure to update C's second foreign key.
Here is what happens:
When I click in the combo-box and press a key, I get the error message:
"this property is read only & can't be set"
After dismissing the error message, the combo-box allows me to set the first
foreign key and then correctly updates the second foreign key in the event
procedure.
After filling in all the fields, attempting to update the record gives the
following message: "index or primary key cannot contain a null value"
This is puzzling because the foreign key to A is handled by the parent :
child relationship of form and subform and the two foreign keys to B contain
valid data.
Can someone help me understand what is going on ?