[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 138
  • Last Modified:

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?

0
djdidge
Asked:
djdidge
1 Solution
 
Éric MoreauSenior .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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now