Hi,
I don't know what's wrong about a simple piece of code.
I'm trying to set the focus back to a control when a user types a wrong value.
Private Sub KENTEKEN_AfterUpdate()
If IsNull(DLookup("[KENTEKEN]", "VRACHTWAGENS", "[KENTEKEN] = '" & Me.KENTEKEN & "'")) Then
Me.KENTEKEN.SetFocus
End If
End Sub
The program goes to the next control even when the data is not find by the Dlookup-method !!!
I don't know what's wrong about a simple piece of code.
I'm trying to set the focus back to a control when a user types a wrong value.
Private Sub KENTEKEN_AfterUpdate()
If IsNull(DLookup("[KENTEKEN]", "VRACHTWAGENS", "[KENTEKEN] = '" & Me.KENTEKEN & "'")) Then
Me.KENTEKEN.SetFocus
End If
End Sub
The program goes to the next control even when the data is not find by the Dlookup-method !!!