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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top