R
rogers
what function do you use (eg in an IIfmnested expression)
to discover if a textfield is NOT null?
to discover if a textfield is NOT null?
Van T. Dinh said:IF Not IsNull([TextField]) THEN ...
However, I prefer to use:
IF Len([TextField] & "") > 0 THEN ...
which eliminate both Null and zer0-length String.
If you use imported data (which can have values with white spaces only),
use:
IF Len(Trim$([TextField] & "")) THEN ...
--
HTH
Van T. Dinh
MVP (Access)
rogers said:what function do you use (eg in an IIfmnested expression)
to discover if a textfield is NOT null?
david epsom dot com dot au said:Typographical error.... should have been:
IF Len(Trim([TextField] & "")) THEN ...
(david)
Van T. Dinh said:IF Not IsNull([TextField]) THEN ...
However, I prefer to use:
IF Len([TextField] & "") > 0 THEN ...
which eliminate both Null and zer0-length String.
If you use imported data (which can have values with white spaces only),
use:
IF Len(Trim$([TextField] & "")) THEN ...
--
HTH
Van T. Dinh
MVP (Access)
rogers said:what function do you use (eg in an IIfmnested expression)
to discover if a textfield is NOT null?
david epsom dot com dot au said:Typographical error.... should have been:
IF Len(Trim([TextField] & "")) THEN ...
(david)
Van T. Dinh said:IF Not IsNull([TextField]) THEN ...
However, I prefer to use:
IF Len([TextField] & "") > 0 THEN ...
which eliminate both Null and zer0-length String.
If you use imported data (which can have values with white spaces only),
use:
IF Len(Trim$([TextField] & "")) THEN ...
--
HTH
Van T. Dinh
MVP (Access)
rogers said:what function do you use (eg in an IIfmnested expression)
to discover if a textfield is NOT null?
Van T. Dinh said:Actually, I did mean:
IF Len(Trim$([TextField] & "")) THEN ...
Trim returns a Variant (of String type) while Trim$ returns a String.
--
HTH
Van T. Dinh
MVP (Access)
david epsom dot com dot au said:Typographical error.... should have been:
IF Len(Trim([TextField] & "")) THEN ...
(david)
Van T. Dinh said:IF Not IsNull([TextField]) THEN ...
However, I prefer to use:
IF Len([TextField] & "") > 0 THEN ...
which eliminate both Null and zer0-length String.
If you use imported data (which can have values with white spaces only),
use:
IF Len(Trim$([TextField] & "")) THEN ...
--
HTH
Van T. Dinh
MVP (Access)
what function do you use (eg in an IIfmnested expression)
to discover if a textfield is NOT null?
david epsom dot com dot au said:???????Actually, I did mean:
Len(Trim$([TextField]) & "")
returns a type conversion error for [TextField] is null
Len(Trim([TextField] & ""))
returns FALSE for [TextField] is null
If in some version of VBA "Trim$(Null)" returns an empty string, then
& ""
would not be required.
(david)
Van T. Dinh said:Actually, I did mean:
IF Len(Trim$([TextField] & "")) THEN ...
Trim returns a Variant (of String type) while Trim$ returns a String.
--
HTH
Van T. Dinh
MVP (Access)
david epsom dot com dot au said:Typographical error.... should have been:
IF Len(Trim([TextField] & "")) THEN ...
(david)
IF Not IsNull([TextField]) THEN ...
However, I prefer to use:
IF Len([TextField] & "") > 0 THEN ...
which eliminate both Null and zer0-length String.
If you use imported data (which can have values with white spaces only),
use:
IF Len(Trim$([TextField] & "")) THEN ...
--
HTH
Van T. Dinh
MVP (Access)
what function do you use (eg in an IIfmnested expression)
to discover if a textfield is NOT null?