If Null

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

Is there a way to write a statement for this without using IF over and
over again?

If any one of these 3 boxes are Null then do this.....

As opposed to...

If IsNull(Text1) Then
DoCmd.OpenForm"1"
ElseIf IsNull(Text2) Then
DoCmd.OpenForm"2"
ElseIF IsNull(Text3) Then
DoCmd.OpenForm"3"
Else:
Do the Following....
End If


Thanks
DS
 
'Nulls propagage'. Or in other words 'if any part of an expression evaluates
as Null, the entire expression evaluates as Null'. Or in other words again
....

? "Not Null" + Null
Null

Therefore ...

Private Sub Command6_Click()

If IsNull(Me.Text0 + Me.Text2 + Me.Text4) Then
MsgBox "The value of at least one of the text boxes was Null"
Else
MsgBox "The value of none of the text boxes was Null"
End If

End Sub
 
Brendan said:
'Nulls propagage'. Or in other words 'if any part of an expression evaluates
as Null, the entire expression evaluates as Null'. Or in other words again
...

? "Not Null" + Null
Null

Therefore ...

Private Sub Command6_Click()

If IsNull(Me.Text0 + Me.Text2 + Me.Text4) Then
MsgBox "The value of at least one of the text boxes was Null"
Else
MsgBox "The value of none of the text boxes was Null"
End If

End Sub
Great Thanks
DS
 
Back
Top