How to cancel Recordset.AddNew?

  • Thread starter Thread starter Ron Sissons
  • Start date Start date
R

Ron Sissons

HI,

I want to be able to cancel the addition of a recordset using
recordset.addnew

I tried me.recordset.cancel, but it didn't work.

What is the property to cancel when recordset.addnew is used?

Ron Sissons, DBA
Information Technology Services
Riverside County Office of Education
3939 Thirteenth Street, Riverside, CA 92502-0868
Telephone: (909) 826-6471; FAX: [909] 826-6451
 
I tried recordset.cancelupdate, but it added the record anyway

Ron Sissons, DBA
Information Technology Services
Riverside County Office of Education
3939 Thirteenth Street, Riverside, CA 92502-0868
Telephone: (909) 826-6471; FAX: [909] 826-6451

HI,

I want to be able to cancel the addition of a recordset using
recordset.addnew

I tried me.recordset.cancel, but it didn't work.

What is the property to cancel when recordset.addnew is used?

Ron Sissons, DBA
Information Technology Services
Riverside County Office of Education
3939 Thirteenth Street, Riverside, CA 92502-0868
Telephone: (909) 826-6471; FAX: [909] 826-6451
 
Ron Sissons said:
I tried recordset.cancelupdate, but it added the record anyway



I want to be able to cancel the addition of a recordset using
recordset.addnew

I tried me.recordset.cancel, but it didn't work.

What is the property to cancel when recordset.addnew is used?

I think you'd better show your code. CancelUpdate ought to work.
 
Actually,

that's what I thought, but in inserted the next row with blank fields(except
the autonumber)

I did docmd.menuitem and referenced the undo command from the edit menu.
I then did a recordset.findnext to go back to the last record I was on
priorto pressing the add button.

this seems to do what I wanted.

Thanks for the reply

Ron Sissons, DBA
Information Technology Services
Riverside County Office of Education
3939 Thirteenth Street, Riverside, CA 92502-0868
Telephone: (909) 826-6471; FAX: [909] 826-6451

Ron Sissons said:
I tried recordset.cancelupdate, but it added the record anyway



I want to be able to cancel the addition of a recordset using
recordset.addnew

I tried me.recordset.cancel, but it didn't work.

What is the property to cancel when recordset.addnew is used?

I think you'd better show your code. CancelUpdate ought to work.
 
Ron Sissons said:
Actually,

that's what I thought, but in inserted the next row with blank
fields(except the autonumber)

I did docmd.menuitem and referenced the undo command from the edit
menu.
I then did a recordset.findnext to go back to the last record I was on
priorto pressing the add button.

this seems to do what I wanted.

Thanks for the reply

It sounds like maybe you were mixing operations on the form's Recordset
with operations on the form itself. If your form is "dirty", executing
Me.Recordset.CancelUpdate isn't going to keep that form record from
being saved.

I'm glad to hear you found a solution.
 
Ron Sissons said:
Actually,

that's what I thought, but in inserted the next row with blank fields(except
the autonumber)

I did docmd.menuitem and referenced the undo command from the edit menu.
I then did a recordset.findnext to go back to the last record I was on
priorto pressing the add button.

this seems to do what I wanted.

Try this

Me.Undo
Docmd.GoToRecord , , acNewRec

I happened to wander across that after reading your post.. As my
Access 2000 help system it was all luck..
Thanks for the reply

Ron Sissons, DBA
Information Technology Services
Riverside County Office of Education
3939 Thirteenth Street, Riverside, CA 92502-0868
Telephone: (909) 826-6471; FAX: [909] 826-6451
 
Back
Top