Close without saving button?

nrgu

New member
Local time
Tomorrow, 04:14
Joined
Feb 7, 2010
Messages
4
I have a form that is used to create or update a new table, and 2 buttons, save, and close w/o saving, however I can't seem to make close w/o saving work? The table gets updated as soon as focus changes. I'm not sure how to implement this, any help appreciated :)
 
Use the Before Update event of the form and set the parameter 'Cancel' to True if you don't want to save.
 
vBaInet's way seems easier, but here's the work around I made up... Discard sets a specific field to blank, and then I have a scrub query that runs in a macro to delete any row with that field blank.
 
vBaInet's way seems easier, but here's the work around I made up... Discard sets a specific field to blank, and then I have a scrub query that runs in a macro to delete any row with that field blank.

Why allow the creation of junk records and then have to take the extra steps to clean up something that is preventable?
 
Why allow the creation of junk records and then have to take the extra steps to clean up something that is preventable?

For me it works as I am logging any time anyone goes to the form and enters data. My way still captures that log.

I'm sure there is a better way, i'm still pretty new to access....

by no means am I saying do it my way, just sharing a work around I use.
 
I'm sorry, but I have to agree with ghudson! Ericryd's approach is absurd, and muddying the situation here by posting it is irresponsible and shows a lack of professionalism on his/her part!
 
Use the Before Update event of the form and set the parameter 'Cancel' to True if you don't want to save.
Sorry to be blonde but if I want to do this as a macro in the Before Update event what command should i use?
 
Welcome to the forum!

I don't use macros but you will need to create a set of conditions. It's easier in code, i.e. Event Procedure.
 
Welcome to the forum!

I don't use macros but you will need to create a set of conditions. It's easier in code, i.e. Event Procedure.

Ok thanks, have done so but thought I may be missing something. :)
 
No you didn't :) You can use either. VBA is more powerful than macros.

Happy developing!
 

Users who are viewing this thread

Back
Top Bottom