• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Controlling Nulls

One of the common bugaboos that haunt novice Access programmers is working with null values. When a field or variable is Null, it signifies that it has no valid data. This is in contrast to zero-length, which means that the value contains a string that has a zero length, or Empty, which means that a variant variable has not been initialized (assigned a value for the first time). All three values are hard to distinguish because they all represent a non or blank value. To help you differentiate between the three, keep the following in mind:

  • Variant is the only data type that can hold the Empty, Null, and Nothing special values.

  • The Null, Empty, and zero-length values all have no character that outputs to either a screen or a printer.

  • The Null value propagates itself throughout expressions, which means that if any component of an expression contains a Null value, the entire expression evaluates to Null.

  • Zero-length strings can be entered into Text, Memo, or Hyperlink fields in an Access database, if the AllowZeroLength field property is set to Yes.

  • You can specifically assign Empty, Null, and string values such as Empty string to the Variant data type.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint