By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,261 Members | 2,662 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,261 IT Pros & Developers. It's quick & easy.

Cancel Row Insert

P: n/a
How can you cancel a row insert programmatically? I'm not talking
about the Form_BeforeInsert(Cancel As Integer). I have a continuous
form. A new row is started. Code for the continuous form captures a
KeyDown event (Ctrl+D) to delete the row. I can tell if the row is
new. I just don't know how to cancel the new row.
Feb 17 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Test the NewRecord property of the form to see if it is the new row.

Test the form's Dirty property to see if a new entry has begun yet.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Paul" <pw****@gmail.comwrote in message
news:94**********************************@q70g2000 hsb.googlegroups.com...
How can you cancel a row insert programmatically? I'm not talking
about the Form_BeforeInsert(Cancel As Integer). I have a continuous
form. A new row is started. Code for the continuous form captures a
KeyDown event (Ctrl+D) to delete the row. I can tell if the row is
new. I just don't know how to cancel the new row.
Feb 17 '08 #2

P: n/a
Paul wrote:
How can you cancel a row insert programmatically? I'm not talking
about the Form_BeforeInsert(Cancel As Integer). I have a continuous
form. A new row is started. Code for the continuous form captures a
KeyDown event (Ctrl+D) to delete the row. I can tell if the row is
new. I just don't know how to cancel the new row.
In someone pressed the Delete button you could, as Allen mentioned, test
for the newrecord property in the OnDelete event.
If Me.NewRecord then Cancel = True

There is the Undo command. You can enter
Me.Undo
to remove reference to the new record in some event.

Destination Unknown
http://www.youtube.com/watch?v=h_opSztg2B0
Feb 17 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.