Adding Record On Query Generates "Cannot Add Record"
Posted: Wed Mar 25, 2009 9:44 pm
Need a little help here on Access:
I have 2 tables:
I made a main form that had a combo-box filter (LocationID) to display the proper information in a sub-form.
The sub-form had a recordsource as follows:
Now the form works visually, I pull down the combo-box with a LocationID and the sub-form displays the specified fields for that LocationID.
However if I try to add a new record I get the message:
Note: My Link Master Field and Link Child Fields are completely blank right now in the properties page.
I have 2 tables:
Code: Select all
Table_Parent with fields:
Order (Primary Key)
AccountID
Code: Select all
Table_Child with fields:
AutoNumber ID (Primary Key)
Order
Cost
LocationID
I made a main form that had a combo-box filter (LocationID) to display the proper information in a sub-form.
The sub-form had a recordsource as follows:
Code: Select all
"SELECT * FROM Table_Parent INNER JOIN Table_Child ON Table_Parent.Order = Table_Child.Order WHERE Table_Child.LocationID = '" & cboLocation & "'"
Now the form works visually, I pull down the combo-box with a LocationID and the sub-form displays the specified fields for that LocationID.
However if I try to add a new record I get the message:
Code: Select all
Cannot add records(s); join key of table 'Table_Child' not in recordset.
Note: My Link Master Field and Link Child Fields are completely blank right now in the properties page.