Open form based on IF condition

DebbieV

Registered User.
Local time
Today, 23:06
Joined
May 7, 2002
Messages
63
Hi All,

I would like to open a new form if the parameter query results is NULL.
could you please help?
Currently a form will prompt a person for 3 pieces of data before producing the form. After the 3 parameters are entered it produces a form with dates entered of an event. If there have been no events I would like it to open a new form rather than the current one.

Debbie
 
Try an on load event the following one will open the other form if one field is null


Private Sub Form_Load()
If IsNull(Me.field1) Then
DoCmd.Close
DoCmd.OpenForm "your other form"
End If
End Sub

or for all three

Private Sub Form_Load()
If IsNull(Me.field1) Then
If IsNull(Me.field2) Then
If IsNull(Me.field3) Then
DoCmd.Close
DoCmd.OpenForm "your other form"
End If
End If
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom