Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2012-03-31
6
Medium Priority
?
1,498 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 400 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 400 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 58

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 400 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 51

Accepted Solution

by:
Gustav Brock earned 800 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

Industry Leaders: 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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…

661 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