Results 1 to 5 of 5
  1. #1
    Jay Pee is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    12

    Disable auto editing records and use "save" button instead

    Hi all,

    To add/manage customers in my database I have made a (main) form with 5 sub forms in it. What I would like to do is to make a "save" button on the main form. Whatever is added (new) or edited (existing) in the main form AND/OR in the subform(s) should only be written to the actual tables after the button on the main form is pressed. If users add or edit fields and close the form without saving, nothing should change the actual data.

    I've been Googling for a while now and so far I've only come up with a code to bind to an event like loosing focus. This code gives me an annoying pop-up with a YES and NO button, but even worse is I have to use to code for the main form and every individual sub form. When I only use the code for the main form to get the pop-up only once, users can still mess around with the fields of the sub forms without having to press a button to confirm their additions or changes.

    How would I create such a button which affects both the main form and all 5 five sub forms?



    Thanks!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You may want to look into Transactions: http://msdn.microsoft.com/en-us/libr...ffice.15).aspx

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Only option I know is unbound forms and code (a lot of code) that writes data to record only when appropriate.

    A primary purpose of form/subform arrangement is to eliminate need for code to write records.

    EDIT: I see RG got a post in first. I have used Transaction but not when several subforms are involved. No idea how that would work.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Jay Pee is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    12
    OK so I get that Access is inherently designed to do pretty much exactly the opposite of what I need..

    I'll go and take a look at transactions.

  5. #5
    Jay Pee is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    12
    It is seems it is almost impossible for me to make this, given my limited knowledge.

    An alternative would be a 'cancel changes' button which cancels all additions/changes to the fields of the selected record in the main form AND in the several sub forms as well. Would this be possible: one button to cancel everything? Note: under no circumstances must that button be allowed to delete data already available prior to opening the form incl its sub forms.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to use "Auto Save" - no more post loss!
    By Matrix in forum Forum Suggestions
    Replies: 6
    Last Post: 11-30-2023, 06:16 PM
  2. How to disable the "close" button in Access
    By Demerit in forum Access
    Replies: 7
    Last Post: 12-08-2013, 07:08 PM
  3. Replies: 5
    Last Post: 02-05-2013, 10:57 PM
  4. saves data with out click "Save" button in forms
    By terrythomasvda in forum Forms
    Replies: 4
    Last Post: 01-14-2013, 01:31 PM
  5. disable "save export steps"
    By emerrube in forum Access
    Replies: 4
    Last Post: 06-28-2011, 01:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums