NULL database fields.... so annoying!

mystring = IIf(rsStud("L1 to OCN") is null , "", rsStud("L1 to OCN"))
*------------
mystring = IIf(rsStud("L1 to OCN") = null , "", rsStud("L1 to OCN"))
*------------
mystring = IIf(rsStud("L1 to OCN") = VbNullString , "", rsStud("L1 to OCN"))
*------------

(rsStud("L1 to OCN") is a text field in an Access2k DB)

all these methods return an error how can i perform this operation?

LVL 2
djdidgeAsked:
Who is Participating?
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
simply use this :
mystring = rsStud("L1 to OCN") & ""
0
 
djdidgeAuthor Commented:
i can see how that works, by converting the null value into an empty string.

That is a bit rubbish on microsoft's part.

anyway thanks emoreau.
0
All Courses

From novice to tech pro — start learning today.