Results 1 to 2 of 2
  1. #1
    sneuberg is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Posts
    23

    Implementing a Clear/Undo button on a form with a mask

    We are trying to implement a Clear button on a form, a button that would erase all entries during a record add and undo changes when the user is editing a record. The way we are current trying to do this is simply with the code:



    Code:
    Me.Dirty Then Me.Undo
    This does what we want except for when the user has entered something in the text box with a mask but hasn't completed the entry when adding a record. In this case the user gets a mask violation error. It's pretty stupid to require the user to enter valid data before they can clear it.

    We need the mask. So the question is how can we implement a Clear button and still have a mask, but not the bogus error message.

    Well actually we could get rid of the mask by separating the SOP number, the text box with the mask, into separate fields in the table, but at this point that would be a lot of work.

    The attached database, a single form and table from a training requirements database, demonstrates this problem.

    I posted this at http://www.access-programmers.co.uk/...d.php?t=284535 but didn't get any replies
    Attached Files Attached Files

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It has me stumped but I've put in a call for some help. We'll see.

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

Similar Threads

  1. Creating a Form Button to Clear Table Data
    By wojosh6 in forum Access
    Replies: 5
    Last Post: 12-10-2015, 01:45 PM
  2. Replies: 2
    Last Post: 03-12-2014, 01:31 AM
  3. Replies: 2
    Last Post: 08-03-2013, 03:41 PM
  4. Replies: 3
    Last Post: 11-18-2011, 03:53 PM
  5. Command button code to clear form
    By windwardmi in forum Forms
    Replies: 15
    Last Post: 11-21-2010, 03:21 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