FAQ | Search | Memberlist | Usergroups | Register | Profile | Inbox | Log in | SmartFeedSmartFeed


 okgg.org > Forum Index > All Things Technical > MS Access: Undo changes made to a subform

  Author    Thread Post new topic  Reply to topic
Shinare
SEXNOCULAR


Joined: 17 Mar 2004
Posts: 13332
Location: Up your butt with a coconut!!
MS Access: Undo changes made to a subform  Reply with quote  

OK, I know this doesn't seem like the place to be posting this, in a gamer forum and all. But I really don't feel like making an account on an MS Access forum just to post something interesting.

Anyway, onto the problem and solution.

Problem:
I have a subform that is a filtered datasheet view that someone can edit. Unfortunately, its not easy enough for the end user to press the "undo" command on the toolbar to undo changes they've made to the record in the subform. They wanted a BIG button on the form that will undo changes made to the record in the subform. I searched the interweb and everyone says "You cant!" but I figured out a way that you can.

Solution:
Main form:
Create a command button "Undo Change" and onClick Me!SubFormName.SetFocus then DoCmd.RunCommand acCmdUndo

(I also use the OnDirty event on the subform controls to hide/unhide the undo button so its only visible when needed)

You cant use Me.Undo, which everyone was (correctly) saying you can not do. But if you pull out the old school acCmdUndo command, it works! Yay for being old!!!
_________________
For with what measure you measure it will be measured to you.

Post Wed Apr 01, 2015 1:03 pm  View user's profile Send private message ICQ Number
  Display posts from previous:      
Post new topic  Reply to topic

Last Thread | Next Thread  >

Quick Reply

  
Jump to:  
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum