Results 1 to 4 of 4
  1. #1
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215

    Saving a Record Edit ONLY if button is clicked?

    Hi all,

    Typically, if I want to edit a record I just create a formed linked to a table or query, make my change to the record, and move on with life. However, I want to make it so that the change ONLY takes effect if you click a button that says something like "Save Record".

    How do you accomplish this?



    Thanks

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Then you may want to use an Unbound Form, and have the button run an Update or Append query to update/add the record.

    Or, you will need to figure out how to "undo" the changes if the button is not pushed. See Bob Larson's post here: http://www.access-programmers.co.uk/...42&postcount=6

  3. #3
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215
    Thank you!

    Perfect. I had to change a few typos, but for the most part it worked. Also, it would be advisable to turn warnings off and then on back again at the beginning and end of the code, respectively.

    Thanks again!

  4. #4
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Looks simple enough, but I don't think it would work for a form with multiple records (continuous form or datasheet). Each time you move to a new record, the form is updated and you'd have to respond to the message. In these cases, I use a temporary table with a boolean variable in the module declarations section to flag the form as dirty (since it is dirty no longer if you move to a new record after an edit). Does anyone have a better method?

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

Similar Threads

  1. Replies: 6
    Last Post: 11-24-2014, 03:55 AM
  2. Replies: 4
    Last Post: 05-16-2014, 12:32 PM
  3. Replies: 7
    Last Post: 11-30-2013, 12:33 PM
  4. Replies: 1
    Last Post: 05-31-2013, 08:53 AM
  5. Replies: 8
    Last Post: 09-27-2012, 11:12 AM

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