G
Guest
Hi gang!
I'm getting error 2115 'The macro or function set to the Before Update
property for this field is preventing the application from saving the data in
the field.'
in a Before Update event of a control.
The control is not bound.
The code basically just trims the length of the string entered if it exceeds
the fields size.
Here's the code:
Private Sub txtName_BeforeUpdate(Cancel As Integer)
If Len(txtName.Value) > 80 Then
txtName.Value = Left(txtName.Value, 80)
MsgBox "The name you have entered exceeds our limit of 80 characters!"
End If
End Sub
The error occurs on the line txtName.Value = Left(txtName.Value, 80)
I tried using .Text instead of .Value, but that mde no difference.
Any ideas?
Access XP, WinXP SP2, SQLServer 2000
Thanks!
I'm getting error 2115 'The macro or function set to the Before Update
property for this field is preventing the application from saving the data in
the field.'
in a Before Update event of a control.
The control is not bound.
The code basically just trims the length of the string entered if it exceeds
the fields size.
Here's the code:
Private Sub txtName_BeforeUpdate(Cancel As Integer)
If Len(txtName.Value) > 80 Then
txtName.Value = Left(txtName.Value, 80)
MsgBox "The name you have entered exceeds our limit of 80 characters!"
End If
End Sub
The error occurs on the line txtName.Value = Left(txtName.Value, 80)
I tried using .Text instead of .Value, but that mde no difference.
Any ideas?
Access XP, WinXP SP2, SQLServer 2000
Thanks!