make a dynaset querydef updateable
Posted on 1998-09-22
I need to update a field that is in a querydef. I have 2 queries.
query 2 is based on query 1. The problem is an error occurs "recordset is read only"
I have looked up the dynaset updateable property and is says that it can be updated.
the first query can be edited but the second can't. how can I get this second query to be updateable?. Are compounded queries read only??? is it because it is based on "dates" and the update property can only update the field of its original table.?
icdpSQL = "SELECT tblSlideDetail.ToSchedule, tblOrders.ProjectName,..... " & " between #" & DATE1 & "# and #" & DATE2 & "#))ORDER BY tblSlideDetail.CompletionDate;"
iccycleSQL = "SELECT [Dates].ProjectName, count([Dates].ItemID) as countofitemid, [Dates].Available, [Dates].ToCycle FROM [Dates] GROUP BY [Dates].ProjectName, [Dates].ItemID, [Dates].Available, [Dates].ToCycle;"
Set icdpQD = dbs.CreateQueryDef("Dates", icdpSQL)
Set icdpRS = icdpQD.OpenRecordset(dbOpenDynaset)
Set iccycleQD = dbs.CreateQueryDef("Cycles", iccycleSQL)
Set iccycleRS = iccycleQD.OpenRecordset(dbOpenDynaset)
Do Until iccycleRS.EOF
If iccycleRS!countofitemid > (iccycleRS!Available * 2) Then
itemover = iccycleRS!countofitemid - (iccycleRS!Available * 2)
totaldays = totaldays + itemover
increasedays = totaldays / numberofdays
If iccycleRS!countofitemid > iccycleRS!Available Then
' this will set the cycle field for the mould that needs cycling
!ToCycle.Value = True