Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete New Record without adding any Information?

Status
Not open for further replies.

firebirdta84

Technical User
Aug 23, 2007
56
US
When the "New Record" button is pressed on my form, it will blank out all the fields and allow the user to enter a new record. One field in that form is the Primary Key. If someone accidentally presses the "New Record" button, they are forced to enter at least the Primary Key. Is there a way to make it so if they accidentally press the "New Record" button but then decide against it, to cancel the whole new record operation? I don't want them to have the ability to delete any previously entered records. Hope this makes sense. Thanks.
 
If you go to a new record, it hasn't been saved, so there isn't technically a record to delete yet.

If the user clicks a navigation button (First, Last etc) it should go to an existing record.

It depends a bit on how you have set up your form... are you using the built in navigation bar on the form?

One thing you could consider, is that when the user clicks on New Record (which i assume is a button you added), you could toggle the caption to Cancel, and modify the code to look at the caption and if it's Cancel, go to another record (eg First, Last).

Max Hugen
Australia
 
I tried what you suggested - clicked the "Add New" Record button and then tried to click the First/Previous/Next/Last buttons on the Navigation bar - it won't let me go to any other record until something is added to the Primary Key field. Any other ideas?
 
What about pressing the Escape key ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top