Link to home
Start Free TrialLog in
Avatar of Saleve
SaleveFlag for Switzerland

asked on

Can I update a recordsetclone?

I have the below code in a form's module, which seems pretty basic.  But it doesn't work.  I get an error message saying, "Run-time error '3020'. Update or CancelUpdate without AddNew or Edit"

Me.RecordsetClone.MoveFirst
Me.RecordsetClone.MoveLast
Do Until Me.RecordsetClone.BOF
    Me.RecordsetClone.Fields("DtSubmitExtraHours") = Date
    Me.RecordsetClone.Update
    Me.RecordsetClone.MovePrevious
Loop

Is the problem that I cannot update a recordsetclone?  

If this is the case, how can I easily update a field on a continuous form for all the records that are currently displayed?  If not, what is wrong?

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

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
Avatar of Saleve

ASKER

Can I do this with an adodb recordset?  When I try this:

Dim rst As ADODB.Recordset
Set rst = Me.RecordsetClone

I get a type mismatch error
Avatar of Saleve

ASKER

When I try with dao recordset I get the same error as before.
Avatar of Saleve

ASKER

Hi again,  In fact, it works with the dao recordset.  I forget to change the other syntax.  I'll accept that solution, but do you know how it could be done with an adodb recordset?