473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Cancel Row Insert

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
2 7923
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: allyn44 | last post by:
HI--what I am trying to do is 2 things: 1. Open a form in either data entry mode or edit mode depending on what task the user is performing 2. Cancel events tied to fields on the form if I am in...
13
by: Tim | last post by:
Hello, Is there a way to "cancel" a response.Redirect? For example, in the code below, could I insert anything in the Catch statement that would cancel the redirect and resume flow after the...
2
by: andrew.roberts | last post by:
This is my second post now on this subject has I seem to be getting no where and the problem is really starting to bug me now. I can get a datagrid into an editable state but then neither the...
1
by: sck10 | last post by:
Hello, When using a FormView, DetailsView or GridView, how do you capture the cancel event when you are in the insert/update mode. I have a formview that I need to hide if the person clicks on...
4
by: Dabbler | last post by:
I'm trying to code a FormView page to return to the Gridview List if the user clicks the Cancel button while in insert mode but nothing happens with the following code: void...
3
by: Siv | last post by:
Hi, Does anyone know how to cancel the selection of a block that has been copied programmatically using C# and Excel Interop. This is my current code: rng=XLApp.get_Range("OrigRows",m);...
0
by: Afshar | last post by:
hi everyone there, i am checking a specific circumstance in Inserting event of FormView or ObjectDataSource controld and wants to be able to cancel inserting based upon my validation. but don't...
0
by: Eraser | last post by:
Hi to all .NET guru guys... I have a problem in my delete button inside gridview. How to avoid postback on when i select cancel on confirmation message? But postback is okay on Ok confirmation....
4
by: sphinney | last post by:
Hi everyone. I'm creating an application inside Access 2007. The application will retrieve data from various locations on my company's network servers. Depending on the time of day, alignment of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.