**Reset Unbound Field**

John M

Registered User.
Local time
Today, 16:30
Joined
Nov 20, 2001
Messages
69
Hi,

Does anyone know how to reset a unbound field?

Situation:
I have a unbound field (default value "0") - when the user enter some invalid I will trap by using:

Private Sub Text73_BeforeUpdate(Cancel As Integer)
If Me.Text73 > Me.Text69 Then
Me.Text73 = 0
Cancel = True
Exit Sub
End If
End Sub

I get the error message:
The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing Microsoft Acess from saving the data in the field.

Thanks
 
I might be wrong but I think the reason you are getting the error is because you are trying to set the field value Me.Text73 = 0 and then you are cancelling the update with Cancel = True. I think you could take the cancel = true out, which stops the record being saved, and leave the Me.Text73 = 0
 
Thanks for the suggest - but it still doesn't work

DBL,

Thanks for your suggestion. I've tried and I still get the same message. The strange thing is that it works for a "bounded" field.

Thanks.
 
Maybe a bit more of an explanation might help. What's text73 for? Why is it unbound and what are you trying to achieve? Maybe we can come up with another way to solve the problem.
 

Users who are viewing this thread

Back
Top Bottom