Blank out field.....??

geralf

Registered User.
Local time
Today, 23:22
Joined
Nov 15, 2002
Messages
212
Hi all

I have a numeric field in a form which initially is set to 0. When the user clicks or tabs to this field, it is blanked out in the got focus event by setting the field to "". This works great. Now, if the user exits the field by clicking elsewhere or tabing out of it, without entering a value, I would like the 0 value to be inserted again. I have tried many things to make this work without any success. Is there someone who knows the right way to do this?

Thanks in advance
 
Thanks for your reply.

I've used the following code at the GotFocus and LostFocus events for the field:


Private Sub VEKTINN_GotFocus()
If Me.VEKTINN = 0 Then Me.VEKTINN = ""

End Sub

Private Sub VEKTINN_LostFocus()
If IsNull(Me.VEKTINN) Then
Me.VEKTINN = 0
DoCmd.RepaintObject acForm, "frmDrossleveranser(det)"
End If
End Sub

Seems to be working OK.

Thanks for your interest
 

Users who are viewing this thread

Back
Top Bottom