H
h3llz
How do i do a notnull statement? (If (IsNotNull(..) Then ...)
BruceM said:In VBA:
If Not IsNull (Me.SomeField) Then
' Do something
Else
' Do something else
End If
The Else part may not be needed, depending on the situation.
In the control source of a text box:
=IIf([SomeField] Is Not Null,"Not Null","Null")
In a query:
NewField: IIf([SomeField] Is Not Null,"Not Null","Null")
This will cause "Not Null" or "Null" to appear in the text box or query
field. Substitute the actual actions you would have performed.
In all cases use the actual field name. In the query you can name the field
as you choose. You don't need to use NewField.
h3llz said:How do i do a notnull statement? (If (IsNotNull(..) Then ...)
h3llz said:I've got this code and it is always returning true, even when the field is
blank
If Not IsNull(txtSuppliedProductID.Text) Then
WHERE = " AND productID=" & txtSuppliedProductID.Text
Else
cmoSuppliedProductName.SetFocus
If Not IsNull(cmoSuppliedProductName.Text) Then
WHERE = " AND productID=" & cmoSuppliedProductName.Text
End If
End If
unless its not null, and is ""
BruceM said:In VBA:
If Not IsNull (Me.SomeField) Then
' Do something
Else
' Do something else
End If
The Else part may not be needed, depending on the situation.
In the control source of a text box:
=IIf([SomeField] Is Not Null,"Not Null","Null")
In a query:
NewField: IIf([SomeField] Is Not Null,"Not Null","Null")
This will cause "Not Null" or "Null" to appear in the text box or query
field. Substitute the actual actions you would have performed.
In all cases use the actual field name. In the query you can name the
field
as you choose. You don't need to use NewField.
h3llz said:How do i do a notnull statement? (If (IsNotNull(..) Then ...)
h3llz said:I've got this code and it is always returning true, even when the field is
blank
If Not IsNull(txtSuppliedProductID.Text) Then
WHERE = " AND productID=" & txtSuppliedProductID.Text
Else
cmoSuppliedProductName.SetFocus
If Not IsNull(cmoSuppliedProductName.Text) Then
WHERE = " AND productID=" & cmoSuppliedProductName.Text
End If
End If
unless its not null, and is ""
BruceM said:In VBA:
If Not IsNull (Me.SomeField) Then
' Do something
Else
' Do something else
End If
The Else part may not be needed, depending on the situation.
In the control source of a text box:
=IIf([SomeField] Is Not Null,"Not Null","Null")
In a query:
NewField: IIf([SomeField] Is Not Null,"Not Null","Null")
This will cause "Not Null" or "Null" to appear in the text box or query
field. Substitute the actual actions you would have performed.
In all cases use the actual field name. In the query you can name the
field
as you choose. You don't need to use NewField.
h3llz said:How do i do a notnull statement? (If (IsNotNull(..) Then ...)
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.