If Then Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.)
 
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.)
 
Back
Top