Results 1 to 3 of 3
  1. #1
    zcanderson is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    2

    Using UndoRecord Command on Blank Form Errors Out

    Thanks for the help in advance. I am creating my first database for a work project have been able to find my way through most of it but am coming up with an error that I can seem to find an answer to. In my form I have a button to "cancel and return to main menu" if they don't want to save what they entered (this works if data is entered into any field). However if they haven't entered anything and I try to run the UndoRecord command it erros out and will not close the form returning to the main menu. I am using the Macro Builder function and my expression is as follows:



    Click image for larger version. 

Name:	CancelButton.JPG 
Views:	8 
Size:	33.4 KB 
ID:	18558

    Thanks again for any help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I don't use macros so don't know if this is available. In VBA code could check if the form IsDirty (meaning record has been edited) and only run code if appropriate.
    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
    zcanderson is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    2
    Thanks for the reply, updated the code to add "Dirty" function and it seems to work great.

    Click image for larger version. 

Name:	CancelButton.JPG 
Views:	8 
Size:	26.1 KB 
ID:	18559

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

Similar Threads

  1. Replies: 4
    Last Post: 06-21-2014, 05:43 AM
  2. Replies: 10
    Last Post: 10-22-2013, 07:35 AM
  3. form control errors
    By Suzie2012 in forum Forms
    Replies: 4
    Last Post: 04-26-2012, 05:22 PM
  4. Replies: 10
    Last Post: 07-25-2011, 12:07 PM
  5. Blank column causing errors on import
    By brickballer in forum Import/Export Data
    Replies: 7
    Last Post: 05-20-2011, 12:54 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