I'm making a form with Microsoft Access and I'm trying to make an AfterUpdate event procedure for a field. I need to know if the value of that field is the default value (or if it's empy). I read that the default value of a field in VBA is Null so I made this:
Private Sub EB1_10_Val1_AfterUpdate()
If Me.EB1_10_Val1.Value = Null Then
MsgBox "hello"
End If
End Sub
This didn't work so I tried this for when the user updates the value in the field and then erases it (empties the field)
Private Sub EB1_10_Val1_AfterUpdate()
If Me.EB1_10_Val1.Value = Empty Then
MsgBox "hello"
End If
End Sub
The messages never pop up. On the other hand I tried changing the default value of the field to 0 but Its not working. The 0 doesn't appear in the field as default when in Form View.
isnull(Me.EB1_10_Val1.Value)andisEmpty(Me.EB1_10_Val1.Value)Me.EB1_10_Val1?