Link to home
Start Free TrialLog in
Avatar of entretec
entretec

asked on

Runtime Error 3426 Cancelled by association

The error 3426 "this action cancelled by an associated object" is driving me nuts. What causes this error. I have a form and a datacontrol and a TDBlist combobox. Sometimes I think I have fixed it and back it comes. There doesn't seem to be any clear documentation on this error. What causes it and how to stamp it out.
Avatar of clifABB
clifABB

What causes it is the data control.

But seriously, what really causes it is a scenario such as the following:
1. You add a record using TDBList (or edit or delete)
2. Through code you cause an update without "notifying" the data control.
3. You move to the next record, add a new record, etc.
4. The data control tries to do an update and finds that the addnew (or edit) is no longer pending.
5. Bang, you have your error.

The harder part is trying to fix the problem.  It seems to occur mostly with grids, because of the way grids work when you move from row to row.  I've gotten this error more times than I can count and, like you, think I've fixed it only to have it crop up again for no apparent reason.  I finally quit using bound grids and only use them unbound.
ASKER CERTIFIED SOLUTION
Avatar of anthonyc
anthonyc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It seems this is more a time-out error rather than a run-time error. Anyway, I just made a retry routine like this:

While...


On Error Resume Next
Retry:
    DoEvents
    Data1.Recordset.AddNew
    If Err > 0 Then
        Err = 0
        GoTo Retry
    End If
Wend