Implementing a Clear/Undo button on a form with a mask (1 Viewer)

sneuberg

AWF VIP
Local time
Today, 03:45
Joined
Oct 17, 2014
Messages
3,506
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:
If 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. 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.


Cross posted at http://www.accessforums.net/showthread.php?t=58112&p=310897#post310897
 

Attachments

  • ClearButton.accdb
    420 KB · Views: 54
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:45
Joined
May 7, 2009
Messages
19,175
cannot its a linked table in there.
 

Users who are viewing this thread

Top Bottom