Launch Form only if certain fields are not null

J

Jay

Good Morning. I have a form that I draw info off a subsequent form launched
thourgh a control button. I would like to stop the subsequent form from
launching if 3 fields are left null (i.e. info has to be inputed before they
can go to the next step).

I'm guessing it's an if-then statement, but I'm still too new to get this
right.

Any suggestions. (using A2K)
 
K

kingston via AccessMonster.com

Yes, use an If-Then statement:

If IsNull(Me.Text1 & Me.Text2 & Me.Text3) Then
Exit Sub
End If

Actually, it's not clear whether you want to stop the form when all 3 fields
are Null or when just any one of the 3 fields are Null. The above If-Then
assumes you want the condition where all 3 are Null. If you want to prevent
the form from launching when any of the 3 are null, use OR:

If IsNull(Me.Text1) OR IsNull(Me.Text2)...
 
Top