Cancelling a record change

  • Thread starter Thread starter Tony Nichols
  • Start date Start date
T

Tony Nichols

Cna anyone tell me if there is a effecient way to cancel
a record change, like using the escape key? Do I use a
sendkeys command?

I want to do some field validation and not except the
change if the validation is not met in the beforeupdate
event.

I also do not want to accept changes in subforms to
related tables so I need to not allow changes in the
subforms as well.

Again thanks in advance for any assistance. Dirk & Paul
thanks for the tip on shuting down the mouse.

Tony Nichols
 
Me.Undo

The above code step will revert the current record back to what it was when
it was last saved.
 
The BeforeUpdate event has a 'Cancel' property, and all
you need to do is include a line in your code like:

IF ValidationExpression =False Then
Cancel = True
End IF

HTH,

TK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top