Results 1 to 2 of 2
  1. #1
    RichardAnderson is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    74

    Need Help: Form Undo Error

    Hello folks,

    I have a form with 2 buttons on it at the bottom. A Save & Close button that works fine. My problem is with the close button.

    On the Close Button, in the OnClick event, I added a 2 step macro.

    First is the command UndoRecord
    Second step closes the form.

    This macro works fine as long as there is something to undo. But if the form is opened and nothing is edited. Then the Close Button gives me an error.



    "The command or action 'Undo' isn't available now."

    I am a major rookie when it comes to access and VBA.
    I searched for a couple hours and could not find a way to check if any fields on the form were changed before executing the UndoRecord command.
    If no fields were changed, then the macro should skip to the step of just closing the window.

    ANy help would be great...

    Thanks.

  2. #2
    RichardAnderson is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    74
    I found the solutions finally....

    In my macro I added an if then else statement.

    If Dirty = True

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

Similar Threads

  1. Replies: 4
    Last Post: 07-30-2013, 02:07 PM
  2. Undo problem
    By Waubain in forum Programming
    Replies: 4
    Last Post: 10-27-2011, 12:36 PM
  3. How to undo acCmdPaste ???
    By focosi in forum Programming
    Replies: 12
    Last Post: 09-25-2011, 01:48 PM
  4. Undo one action only
    By zoooza84 in forum Access
    Replies: 5
    Last Post: 08-21-2011, 03:04 PM
  5. Conditional Formatting through VBA: On Undo
    By Remster in forum Programming
    Replies: 6
    Last Post: 04-13-2011, 09:04 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