G
Guest
I'm attempting to import data from an access query into an excel spreadsheet.
Everything works great unless one of the fields does not contain data. I
then get an error message Invald use of Null... run time error '94'
This is the code that I'm trying to use to handle that situation but it
never follows the "true" path when the field is null.
If Nz(rst("" & rst2("SchoolCode") & "")) = Null Then
.Range(colname).Value = "-"
Else
.Range(colname).Value = CStr(rst("" &
rst2("SchoolCode") & ""))
End If
Any help would be greatly appreciated.
Everything works great unless one of the fields does not contain data. I
then get an error message Invald use of Null... run time error '94'
This is the code that I'm trying to use to handle that situation but it
never follows the "true" path when the field is null.
If Nz(rst("" & rst2("SchoolCode") & "")) = Null Then
.Range(colname).Value = "-"
Else
.Range(colname).Value = CStr(rst("" &
rst2("SchoolCode") & ""))
End If
Any help would be greatly appreciated.