473,395 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Disabling the Auto Save Function

Hello,

I've constructed a data entry form in Access 2003 that is bound to two related tables. A subform is embedded into the main form.

I enter data for the parent table into the main form and data for the child table into the subform.

By default, Access saves the record on the main form to the database if I move to the next record in the subform.

I would prefer to control when Access saves a record so I can have better control over validating the entries. Is it possible to control when Access saves a record on a bound form?
Jun 23 '07 #1
4 12521
FishVal
2,653 Expert 2GB
Hello,

I've constructed a data entry form in Access 2003 that is bound to two related tables. A subform is embedded into the main form.

I enter data for the parent table into the main form and data for the child table into the subform.

By default, Access saves the record on the main form to the database if I move to the next record in the subform.

I would prefer to control when Access saves a record so I can have better control over validating the entries. Is it possible to control when Access saves a record on a bound form?
Hi!

You can handle Form BeforeUpdate event.
An example below will disable saving to db at all.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2. Me.Undo
  3. End Sub
  4.  
Jun 23 '07 #2
missinglinq
3,532 Expert 2GB
You're right! The example given will disable all saving to db, but what's the point of having a database that you can never save a record to?

When you leave the record (to go to the subform) you have two choices, either save the record or dump it. If you need to do data validation, you need to do it at this point, using, as pointed out, the Form_BeforeUpdate event. You cannot enter data on the main form, freeze it, so to speak, go to the subform and then come back to it!
Jun 23 '07 #3
FishVal
2,653 Expert 2GB
You're right! The example given will disable all saving to db, but what's the point of having a database that you can never save a record to?

When you leave the record (to go to the subform) you have two choices, either save the record or dump it. If you need to do data validation, you need to do it at this point, using, as pointed out, the Form_BeforeUpdate event. You cannot enter data on the main form, freeze it, so to speak, go to the subform and then come back to it!
Right. This is what I've pointed out.
Sure that BeforeUpdate should contain more useful code, e.g. data validation, confirmation message etc. I've given an idea only.

By the way, setting Cancel=True in BeforeUpdate handler causes an interesting but useless effect when moving to subform:
focus is moved to subform,
record in mainform stays unsaved and never got focus again :-/
Jun 23 '07 #4
FishVal & missingling,

Thank you for responding. Now I realize the this approach is not a pratical one. missingling,
Thank you for pointing out how the records are treated when you leave the main form. I wasn't aware that there were only two options at that point: save or dump. I was naively under the express that the records can be frozen while navigating through each form.

Thanks again.
Jun 25 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Barry | last post by:
Hello, I've recently noticed that someone can simply type in the URL to my javaScript, from my HTML source code, to the explorer location bar and an auto-save dialog pops up to let them save it...
15
by: Hal Robertson | last post by:
I have created a rather complicated series of html forms for a data entry wizard In my mozilla browser, every time I submit each form along the process, it asks me if I want to remember the...
18
by: nenad | last post by:
Wouldn't it be nice if we could do something like this: class Funky{ public: auto virtual void doStuff(){ // dostuff } };
5
by: Lyn | last post by:
Hi, I hope someone can help. I have a main form which mostly fills the Access window. In the bottom half of this form I have a tab control to display various types of data related to the main...
1
by: Jason Galvin | last post by:
I would like to disable the auto-populating feature (remembers form element text between post-backs) when creating a .NET form. I have succeeded in disabling auto-populate by creating my controls...
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
1
by: kkuniya | last post by:
Situation : - A form (method : POST, action : itself, onsubmit : alert 'Submit' ) - Got 2 submit button ( 'Save' , 'View') - Got navigation 1|2|3|4 What I want to do : - Once clicked on the...
2
by: john | last post by:
Is it true that if I split my access database in backend and frontend and I implement custom auto increment for the ID fields, that my database is ready to be used in a multi-user environment? I...
10
by: Sebarry | last post by:
Hi, Probably not a great place for this post, but FCKeditor is very well used so hopefully someone can help. Basically I have a form with two buttons - an edit button that creates an FCKeditor...
2
WhiteRider
by: WhiteRider | last post by:
Hi folks! I'd like to know if theres a way to stop Linux (or at least Slax) from making a backup of an edited file. For example when you make a text file, edit it and then save it , lets say, as...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.