Null fields and how to use IsNull

The {Product.Color} field contains both basic colors such as "red" and "black" and more descriptive two word colors such as "steel satin" and "jewel green". Here's an example of a formula that writes out "basic" for the basic colors and "fancy" for the others.

If InStr({Product.Color}, " ") = 0 Then
    formula = "basic"
Else
    formula = "fancy"
End If

The function call to InStr searches the {Product.Color} string for a space. If it finds a space, it returns the position of the space, otherwise it returns 0. Since basic colors are only one word with no spaces, InStr will return 0 for them.



Seagate Software, Inc.
http://www.seagatesoftware.com
Please send comments to:
techpubs@seagatesoftware.com