How to cancel Recordset.AddNew?

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
 
R

Ron Sissons

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
 
D

Dirk Goldgar

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.
 
R

Ron Sissons

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.
 
D

Dirk Goldgar

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.
 
E

Edward Rudd

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top