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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing a form without saving 1

Status
Not open for further replies.

postmanphat

Technical User
Nov 13, 2006
117
GB
Hi,

Is it possible to close a form without saving the information you've entered?

I have a database where users enter details when a new grant application is received. If somebody starts entering info then half way through, for whatever reason, they decide they want to discard that info. At the moment the 'close' button (created using the button wizard - close form) automatically saves the info before closing the form. I want another button to close the form and discard the data.

Many thanks in advance,

Dave
 
If you do not have any subforms and if the data has not been saved in any other way, Undo may suit. However, I have found that it is generally easier in the end to use an unbound form to collect the essential information for new records.
 
The form has a tab control on it and subforms on each page of the tab control. Good idea about using an unbound form to initially capture the data, I'll remember that for future use! - but I've obviously put a hell of a lot of work into my bound forms so I'll keep that as a last resort for now.

I suppose I could just have a delete buttoin that would delete the current record being worked on... its just a data entry form so there would be no danger of people accidentally deleting completed forms....
 
I've used delete record and it works a treat.

Thanks anyway.

Can I give myself a star?
 
If you are using delete, make sure you compact and repair regularly.
 
You may try this in the Close event procedure of the form:
If Me.Dirty Then Me.Undo

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

Part and Inventory Search

Sponsor

Back
Top