If Then Statement

N

neenmarie

I'm trying to use an If / Then statement for naviational purposes. My "non
working" code won't even get me past the first part. The code (used in the
"lost focus" event of another control) is as follows:

If Me.Control1 Is Null Then
Me.Control1.SetFocus
Else
Me.Parent.SetFocus
Me.Parent.Form!ControlA.SetFocus
DoCmd.GoToRecord , , acNewRec
End If
 
A

Allen Browne

In VBA code, use the IsNull() function, i.e.:
If IsNull(Me.Control1) Then

(The test if something Is Null works in the context of a query.)
 
N

neenmarie

Thank you...all is well


Allen Browne said:
In VBA code, use the IsNull() function, i.e.:
If IsNull(Me.Control1) Then

(The test if something Is Null works in the context of a query.)
 
Top