This action was cancelled by an associated object

  • Thread starter Thread starter Evan
  • Start date Start date
E

Evan

I'm trying to use transaction processing to rollback
changes on a form and related subform.

I set both the form recordset and subform using DAO to
set the form recordset property. The recordsets are
based on queries (i.e. not direct table access). I need

Set qdfBudCom = dbs.CreateQueryDef("", "Select *
from ...") - Main Record
Set qdfCF = dbs.CreateQueryDef("", "Select *
from ...) - Subform Record


Set rstBudCom = qdfBudCom.OpenRecordset

Set Me.Recordset = rstBudCom
Set rstCF = qdfCF.OpenRecordset
Set Subform_Frm.Form.Recordset = rstCF

I have button that needs to do updates to the records on
the subform. This includes deleting records and
rebuilding the rows.

I have a function that I call that passes the recordset
and tries to delete the rows and re-insert new rows into
the recordset. The delete seems to work ok, but when I
try to use the addnew method, I get an error "This action
was cancelled by an associated object"

Public Sub CashflowDist(ByRef rsCashFlow As
DAO.Recordset...)

..
..
..
While rsCashFlow.EOF = False
rsCashFlow.Delete
rsCashFlow.MoveNext
Wend
..
..
..
With rsCashFlow
.AddNew
..
..
..

It errors right on the line with ".AddNew

I'm really stuck, any suggestions?
 
Back
Top