M
Michael J. Strickland
VB (and VBA) do not handle Null values consistently.
The statement "Null = Null" is a true statement.
VB incorrectly returns Null as the result.
The statement (Null & "") = (Null & "") is also a true statement.
VB correctly returns True as the result.
This inconsistency causes Primary Keys to fail as duplicate detectors.
With a one field Primary Key, two records each containing
Null in this key field are not considered duplicates
when in fact they are.
With a two field Primary Key, two records each containing
Null in one key field and identical values in the other
key field, are considered identical.
--
The statement "Null = Null" is a true statement.
VB incorrectly returns Null as the result.
The statement (Null & "") = (Null & "") is also a true statement.
VB correctly returns True as the result.
This inconsistency causes Primary Keys to fail as duplicate detectors.
With a one field Primary Key, two records each containing
Null in this key field are not considered duplicates
when in fact they are.
With a two field Primary Key, two records each containing
Null in one key field and identical values in the other
key field, are considered identical.
--