Solved

Access 2010: Forms Commit Data Changes When Record Is Changed - Yikes!

Posted on 2012-03-31
6
1,403 Views
Last Modified: 2012-03-31
Hello  - New to Access 2010, I am noticing Access 2010 seems to commit data changes in text boxes, on a bound form ONLY when a different record is displayed on the form - NOT when the focus moves to a different text box (After Update) on the form as in Access 2003!  - This behavior is problematic.

I understand it is possible to add the VBA command:
DoCmd.RunCommand acCmdSaveRecord
to the On Change event for all text boxes, but this seems very inefficient - particularly if there are lots of text boxes on the form (and many forms!).

So, how is it possible to have data changes in text boxes committed to the underlying table After Update for ANY text box on a form, without having to add a Do Command to each text box On Change event?

Many Thanks - Jacob
0
Comment
Question by:Chi Is Current
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 100 total points
ID: 37790232
It's not possible.  If you want to save changes on every data change you have to put to Save command into your code.

Why is it a problem for you? This is how the entire IT database world works, not just Access. And most other databases require a Save or Submit button to be clicked.
0
 
LVL 9

Expert Comment

by:OCDan
ID: 37790568
I agree with peter57r this is how the vast majority of systems work, thats why you have a save/apply button on many forms within programs.

Can I ask why it is that you need the changes to be saved after exit of each field?
0
 
LVL 20

Assisted Solution

by:clarkscott
clarkscott earned 100 total points
ID: 37790710
Actually, the way it works is best because you can CANCEL the entire change of the record, or a single text box by hitting esc (once for current field, twice to return the entire record back to original).     Also, you will eventually leave the record, and that's when the changes are saved.

Scott C
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 57

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 100 total points
ID: 37790828
Jacob,

  Not to pile on here, but I would ditto what the others have said; this is the norm.

 The only wrinkle Access has is with subforms.  When you move to a subform, it comitts the main form record.  That is a problem for most because if the user wants to cancel the edit, you'd want to do it as a unit (main and subs), but the main has already been saved and you simply can't undo.

  But outside of that, it works as expected.

  You also should be aware that most controls have:

 .Text - Current value before the user moves focus to another control
 .Value - Current value comitted to buffer
 .Oldvalue - Value of the control when the record was loaded.

  Maybe that will help with what your trying to accomplish.

Jim.
0
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 200 total points
ID: 37790837
Oh, it certainly can be done - using class programming and WithEvents.
Here is how:

http://www.vb123.com/index.html?199812_mk_events.htm

Further about DEEP, Dynamic External Event Procedures, by Shamil Salakhetdinov, the first to describe this in full for practical use:

http://www.vb123.com/index.html?199901_ss_event.htm

That said, most working with this - including myself - have left Access and VBA and turned to Visual Studio and WinForms because if you drive the technique to some limits (well beyond the examples here), Access will crash so you end up wasting your time.

/gustav
0
 
LVL 2

Author Comment

by:Chi Is Current
ID: 37791758
OK.  Thank you all for your insight and questions here.  Yet another opportunity for re-envisioning the way I look at Access and adjusting accordingly.

With Best Regards, Jacob
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question