Only save record in subform when a save button is pressed (1 Viewer)

patkeaveney

Registered User.
Local time
Today, 05:43
Joined
Oct 12, 2005
Messages
75
Hi

I have a main form with several command buttons.

When a new record is added to the sub form . I dont want access to update the record automatically.
I only want the record Saved when a Save buton is pressed on the main form
(This is to allow certain validation on the subform/main form to be completed.)

At the moment the subform record is saved as soon as i move from the subform (eg press one of the other command buttons).


Any help would be greatly welcomed.

Pat Keaveney
 

MarkK

bit cruncher
Local time
Yesterday, 21:43
Joined
Mar 17, 2004
Messages
8,180
This Access behavior you describe is the default behavior and somewhat difficult to circumvent except by using an unbound form, which is labour intensive. What I might do in this case is add a Yes/No field 'Confirmed' to the table. When the form closes always run something like...
Code:
CurrentDB.Execute "DELETE FROM YourTable WHERE Not Confirmed"
To ensure a record is saved, set it's Confirmed field to True.
 
R

Rich

Guest
Use the BeforeUpdate event of the subform if you want to validate entries
 

Users who are viewing this thread

Top Bottom