CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    invalid use of null


    <vbcode>
    If rstCurrent("City") = "" Then
    txtCity = ""
    Else
    txtCity = rstCurrent("City")
    End If
    </vbcode>

    rstCurrent is a recordset, txtCity is a textbox. The code above generates "Invalid use of null". How can I check if rstCurrent("City") is indeed Null?

    thanks a lot


  2. #2
    Join Date
    Apr 1999
    Location
    Rotterdam, Netherlands
    Posts
    278

    Re: invalid use of null

    Try this:

    If IsNull(rstCurrent("City")) then
    txtCity = "null"
    ElseIf rstCurrent("City") = "" then
    txtCity = ""
    else
    txtCity = rstCurrent("City")
    End If




    Crazy D :-)
    "One ring rules them all"

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

Featured