Hit the Debugging 'brick wall' (1 Viewer)

jjturner

Registered User.
Local time
Today, 03:26
Joined
Sep 1, 2002
Messages
386
I'm stumped. :(

During the 'Submit Updates' click event on my form (which includes a host of procedure calls, one of which re-binds my controls to their respective fields in the recordset) I get the following Run-time error:

Run-time error '3020':

Update or CancelUpdate without AddNew or Edit


The code stops on any assignment of value to any of the bound controls. I don't have any explicit recordsets declared or opened during the procedure.

I think I've avoided cascading events. Not sure where next to start stepping thru code or what to look out for . . .

Any ideas?

Many TIA,
John
 

DanR

Registered User.
Local time
Today, 12:26
Joined
Mar 14, 2002
Messages
54
John

You may have already tried this but...

you could try addressing the recordset explicitly, and then using the edit and update commands before and after you assign values.

Dim rst as recordset
Set rst = form.recordset

Then to assign values you could refer to the fields directly

Eg

With rst

.edit
!field1 = 27
!field2 = "string"
.update

End with

-----------------

Good luck

Dan
 

jjturner

Registered User.
Local time
Today, 03:26
Joined
Sep 1, 2002
Messages
386
Dan,

Firstly, I appreciate your taking the time to respond, so please don't regard my remarks as coming from an ungrateful lout (even if it's true ;) ).

Unfortunately, producing another copy of the form recordset would be tantamount to creating recordset locks since the form recordset is already open. Writing to another copy of the form recordset while it's still open would just exacerbate the problem.

The RecordsetClone object is probably what you have in mind, which as I've recently discovered doesn't seem to produce record locks with the Form recordset. However, this kind of workaround is dodging the problem, and truth be told is bad practice. Ideally, I need to identify the cause of the problem.

Since the error is generated implicitly (which is the puzzling aspect of it), I'm doing something wrong - quite likely some redundant or conflicting code execution, or perhaps some conceptual oversight or dis-ordered code. But as I've not dealt with this error before, I'm at a loss as to how it could happen.

Thanks again for the suggestion, though.

Still Puzzled,
John
 

Users who are viewing this thread

Top Bottom