BeforeUpdate Validation problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form in access that displays data on a datagrid. So what I want is that when someone edits a cell and that new value is wrong I want to display a messagebox telling the error but also set the cell's value to the old one automatically
How can I achieve this?
 
Carlos Caraccioli said:
I have a form in access that displays data on a datagrid. So what I want
is that when someone edits a cell and that new value is wrong I want to
display a messagebox telling the error but also set the cell's value to the
old one automatically.
How can I achieve this?

In the BeforeUpdate event of the control...

If SomeTest = False Then
MsgBox "Try again please."
Cancel = True
Me.NameOfControl.Undo
End If
 
Back
Top