Results 1 to 3 of 3
  1. #1
    Davince is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    6

    to Undo, or not to Undo...

    I've got a form in an access 2007 Db that I've put a 'save & close' button on, which in a Macro checks to see if you've entered data correctly before it saves, if you haven't it brings up a message box that says 'data missing, record will not be saved, are you sure you want to exit' - if you click 'no' it takes you back to the form to carry on, if you click 'yes', I had it set to 'Undo' then 'close' - to make sure half finished / improper records weren't created.

    That works fine... if you've started entering data. But if you hit 'save and close' without actually entering any data into any field at all - it closes down, but it brings up an error saying 'Undo not available at this time' AFTER it's closed the form.



    Sooooo... is there a neater solution? or a way of making the macro check to see if there has been any entry?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Is this macro or VBA?

    Check if the form IsDirty before executing Undo.
    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.

  3. #3
    Davince is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2015
    Posts
    6
    Thanks June sorted!

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

Similar Threads

  1. undo delete
    By jaco in forum Access
    Replies: 1
    Last Post: 11-23-2014, 02:46 PM
  2. Undo New Record IF
    By data808 in forum Programming
    Replies: 3
    Last Post: 02-22-2014, 07:59 AM
  3. Undo problem
    By Waubain in forum Programming
    Replies: 4
    Last Post: 10-27-2011, 12:36 PM
  4. How to undo acCmdPaste ???
    By focosi in forum Programming
    Replies: 12
    Last Post: 09-25-2011, 01:48 PM
  5. Undo one action only
    By zoooza84 in forum Access
    Replies: 5
    Last Post: 08-21-2011, 03:04 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