Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 01-21-2008, 10:50 AM   #1
patkeaveney
Registered User
 
Join Date: Oct 2005
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
patkeaveney is on a distinguished road
Only save record in subform when a save button is pressed

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

patkeaveney is offline   Reply With Quote
Old 01-21-2008, 11:01 AM   #2
MarkK
Super Moderator
 
MarkK's Avatar
 
Join Date: Mar 2004
Location: Vancouver BC
Posts: 7,761
Thanks: 10
Thanked 1,290 Times in 1,227 Posts
MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all
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.
__________________
formerly known as lagbolt | Windows 10 | Access 2010 | Visual Studio 2013 | "Institutions have a vested interest in perpetuating the problems to which they are the solution." - Clay Shirky
MarkK is offline   Reply With Quote
Old 01-21-2008, 02:53 PM   #3
Rich
Guest
 
Posts: n/a
Use the BeforeUpdate event of the subform if you want to validate entries

  Reply With Quote
Old 02-05-2008, 03:30 PM   #4
patkeaveney
Registered User
 
Join Date: Oct 2005
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
patkeaveney is on a distinguished road
thanks Rich

patkeaveney is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Save Record Command Button Richie2837 Forms 1 06-15-2007 06:37 AM
Custom save button on form preventing subform da poet Forms 1 06-21-2005 12:38 PM
Saving Record only when Save Button Pressed Bert666 Forms 2 03-06-2003 07:45 PM
Find Record Button not working on subform Quasius Forms 1 08-07-2002 01:04 PM
Button on main form to delete record on subform not_rich_yet Forms 2 03-31-2002 06:13 AM




All times are GMT -8. The time now is 11:51 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World