I bang my head against the wall on this one. I looked at some old database reporting code written in VB6 and came across this line (the code moves the data from the "source" database to the reporting database):
rsTarget!VehYear = Trim(Str(rsSource!VehYear))
If rsSource!VehYear- Null, the line above generates an "Invalid Null Usage" error at runtime. If I break the above line and in the Immediate panel, enter the following:
?rsSource!VehYear
He deduces Null. Ok, that makes sense. Then I try to reproduce the error:
?Str(rsSource!VehYear)
I get an "Invalid Null Usage" error.
However, if I enter the following into the Immediate window:
?Str(Null)
. Null.
Trim() Str(), . ?Trim(rsSource!VehYear) Null, ?Trim(Null). .
, : Str(rsSource!VehYear) " Null" , Str(Null) , , rsSource!VehYear Null?
:. Immediate, ( ):
?Str(rsSource!VehYear.Value)
Null. , rsSource!VehYear ADODB.Field, Value , Str Value ( Null). ( " Null" ) , Str Null, Null - , ?
, Str() - , " Null" (- , , " " Null ", , Field).
- , ?
:
?Str(rsSource!VehYear)
" Null" , rsSource!VehYear - Null,
?Str(rsSource!VehYear.Value)
Null.
Trim(rsSource!VehYear) Trim(rsSource!VehYear.Value) Null.