Subform field cannot be updated

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is a problem that keeps occurring on a subform I have on a main form.
When I move to the subform to add a record, I get the error message "Field
cannot be updated". Can someone tell me the reason this might be happening?

Thanks in advance,
 
Is the subform based on a query? If so, can you edit the fields in the
query, and can you add new records there?

If the subform's query contains more than one table, post the SQL statement
for the query.

What is in the LinkMasterFields and LinkChildFields properties of the
subform control?
 
Hi Allen,

Thanks for the response. The subform is based on a query with only one
table and the SQL statement is listed below. I did forget to mention,
though, that after I get the error message, Access lets me go ahead and add
the record anyway. (Odd?)
The query behaves the same way.

In subform control:
LinkMasterFields = CODE
LinkChildFields = CODE

SELECT Trim(NET2!CODE) & Trim(NET2!LOCATION) AS NetLoc, NET2.LOCATION,
NET2.LOC_FLAG, NET2.MaintInterval, NET2.LastInspection,
DateAdd("m",NET2!MaintInterval,NET2!LastInspection) AS NextInspection,
NET2.Address, NET2.InstallDate, NET2.LastRepair, NET2.ConfinedFlag,
NET2.ConfinedComment, NET2.XCoord, NET2.YCoord, NET2.ZCoord, NET2.AboveGrade,
NET2.CODE, NET2.RECORD_NUMBER
FROM NET2
ORDER BY NET2.LOCATION;
 
Glenn Suggs said:
Hi Allen,

Thanks for the response. The subform is based on a query with only one
table and the SQL statement is listed below. I did forget to mention,
though, that after I get the error message, Access lets me go ahead and add
the record anyway. (Odd?)
The query behaves the same way.

In subform control:
LinkMasterFields = CODE
LinkChildFields = CODE

SELECT Trim(NET2!CODE) & Trim(NET2!LOCATION) AS NetLoc, NET2.LOCATION,
NET2.LOC_FLAG, NET2.MaintInterval, NET2.LastInspection,
DateAdd("m",NET2!MaintInterval,NET2!LastInspection) AS NextInspection,
NET2.Address, NET2.InstallDate, NET2.LastRepair, NET2.ConfinedFlag,
NET2.ConfinedComment, NET2.XCoord, NET2.YCoord, NET2.ZCoord, NET2.AboveGrade,
NET2.CODE, NET2.RECORD_NUMBER
FROM NET2
ORDER BY NET2.LOCATION;

No field in a query that contains an expression will editable. Trim(),
DateAdd(), etc.. For them to have any chance of being editable they must
contain (only) a field name from one of the tables.
 
I'm having the same problem, but any field I try to change returns the
error message. After I click okay, I'm able to continue editing the
record and all is fine.

Is your main form by any chance using the same recordset as the
subform? Mine is - I'm going to try changing it.
 
When I changed the query for my main form so it no longer uses the
records that are on the subform, the problem went away. So it would
appear that the main form had a lock on the records being used on the
subform. Strange that it ultimately let me add a record the way I had
it originally.
 
When I changed the query for my main form so it no longer uses the
records that are on the subform, the problem went away. So it would
appear that the main form had a lock on the records being used on the
subform. Strange that it ultimately let me add a record the way I had
it originally.
 
Back
Top