Results 1 to 4 of 4

Thread: Question Regarding Null values in a RS [RESOLVED]

  1. #1

    Thread Starter
    Addicted Member kidlaley's Avatar
    Join Date
    Jun 2002
    Location
    California
    Posts
    159

    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......
    ]

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    use :
    Code:
    if rs.fields("SOMETHING) is NULL then
    NULL is never equal to anything including itself.

  3. #3

    Thread Starter
    Addicted Member kidlaley's Avatar
    Join Date
    Jun 2002
    Location
    California
    Posts
    159

    no luck....

    i get this error.. 'Object Required'

    heres my code
    VB Code:
    1. If RS.Fields("Date Complete (estimate)") Is Null Then
    2.    LItem.SubItems(4) = "???????"
    3. Else
    4.    LItem.SubItems(4) = RS.Fields("Date Complete (estimate)")
    5. 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......
    ]

  4. #4

    Thread Starter
    Addicted Member kidlaley's Avatar
    Join Date
    Jun 2002
    Location
    California
    Posts
    159

    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
  •  



Click Here to Expand Forum to Full Width