R
Rob Hofkens
Hello everyone 
I have a textbox with a BeforeUpdate procedure that has some code to
validate the entered data.
When the validation fails I set Cansel to True.
But when it's valid I would like to change the entered data and store it in
the textbox value (or text) property.
This result in an error 2115 though
I go arround this problem by changing the data in the AfterUpdate sub but I
wonder why it doesn't work ?
Little sample just to show you what I mean:
Private Sub Sample_BeforeUpdate(Cancel As Integer)
If IsNumeric(Sample.Text) Then
Me.Sample.Value = Me.Sample.Text * 2
Else
Cancel = True
End If
End Sub
Rob.

I have a textbox with a BeforeUpdate procedure that has some code to
validate the entered data.
When the validation fails I set Cansel to True.
But when it's valid I would like to change the entered data and store it in
the textbox value (or text) property.
This result in an error 2115 though

I go arround this problem by changing the data in the AfterUpdate sub but I
wonder why it doesn't work ?
Little sample just to show you what I mean:
Private Sub Sample_BeforeUpdate(Cancel As Integer)
If IsNumeric(Sample.Text) Then
Me.Sample.Value = Me.Sample.Text * 2
Else
Cancel = True
End If
End Sub
Rob.