Edit recordset querydef that has a calculated field

kt1978

Registered User.
Local time
Today, 19:08
Joined
Jan 15, 2011
Messages
43
Hi

Is it possible to add/edit a record from a DAO querydef that has a calculated field in.

Code:
Set qdf = db.QueryDefs("qryOutput_" & strDept)
  qdf.Parameters("Enter Date") = dDate
  Set rs = qdf.OpenRecordset()

Using the rs.Edit or rs.AddNew worked fine until I put a calculated field in the query.

The calculated field is just a total of some fields in the table.

I thought this was something to do with dbOpenDynaset but it just keeps having the same error

Cannot update. Database or object is read-only.

Thanks
 
Depends on your calculated field, what calculation does it do? Normally it shouldnt be a problem, however ifyou are getting this error.... you seem to be "stuck" for one reason or another.
 
Hi

The calculated field is just a simple

Total: Sum([Field1]+[Field2]+[Field3])

Thanks
 
That is not a simple calculation. The Sum makes it an aggregate query and is therefore not updateable.
 

Users who are viewing this thread

Back
Top Bottom