|
-
Oct 22nd, 2002, 03:41 PM
#1
Thread Starter
Addicted Member
Question Regarding Null values in a RS [RESOLVED]
i create a recordset (RS) and sometimes the fields return a Null value.. the thing is that when i want to pass the value to a variable, it gives me an error...
i have try an if statement something like this
if rs.fields("Something") = Null then
Variable = 0
else
variable = rs.fields("Something")
end if
but the thing is that vb executes the else line!!!!
how can i catch the Null Value????
help please
Thanks
Last edited by kidlaley; Oct 22nd, 2002 at 03:59 PM.
There's only Three kinds of people in this world.....
Those that know how to count, and those that do not......
 ]
-
Oct 22nd, 2002, 03:48 PM
#2
Frenzied Member
use :
Code:
if rs.fields("SOMETHING) is NULL then
NULL is never equal to anything including itself.
-
Oct 22nd, 2002, 03:56 PM
#3
Thread Starter
Addicted Member
no luck....
i get this error.. 'Object Required'
heres my code
VB Code:
If RS.Fields("Date Complete (estimate)") Is Null Then
LItem.SubItems(4) = "???????"
Else
LItem.SubItems(4) = RS.Fields("Date Complete (estimate)")
End If
error occurs on the first line
HELLLLLLPPPPP
There's only Three kinds of people in this world.....
Those that know how to count, and those that do not......
 ]
-
Oct 22nd, 2002, 03:58 PM
#4
Thread Starter
Addicted Member
nevermind!!!! I GOT IT!!!
I used the IsNull() and it work perfect...
i had it to get a thick vb book in order to find it but i got it!!!!
thanks for the help!!!!
There's only Three kinds of people in this world.....
Those that know how to count, and those that do not......
 ]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|