Re: Avoiding access to save on close event (1 Viewer)

jp2468

Registered User.
Local time
Today, 11:22
Joined
Sep 30, 2010
Messages
17
Re: Avoiding access to save on close event

Hi, guys,

I created a VBA code to avoid wrong data saving at Form level; However, when I close database, all the data at data entry form which should not saved by VBA code still be saved.

Is anyone can help for avoiding wrong data saved at database application level?

Thanks a lot.
 

boblarson

Smeghead
Local time
Today, 08:22
Joined
Jan 12, 2001
Messages
32,059
Re: Avoiding access to save on close event

I moved this to a new thread as the other was fairly old and long.

As mentioned in the other thread, you use the form's BEFORE UPDATE to validate the record or cancel it. That is the place to do it.

If you don't want it saved then you issue a

Cancel = True

in the Form's Before Update event and it won't save it.

You can add

Me.Undo

after the cancel if you want to undo all of the form's controls.
 

jp2468

Registered User.
Local time
Today, 11:22
Joined
Sep 30, 2010
Messages
17
Re: Avoiding access to save on close event

Thanks, Bob,

I will try.
 

Users who are viewing this thread

Top Bottom