locked
Null declaration ignored RRS feed

  • Question

  • Private Sub ListView2_Click()
    Call d("Select * from Inventory Where ID=" & ListView2.SelectedItem)


    If rs!SellingPrice = Null Then
    MsgBox "Product's selling price is not set!", vbExclamation, "System"
    Exit Sub
    End If

    Text1.Text = rs!ItemCode
    Label4.Caption = rs!ItemName
    Label8.Caption = rs!SellingPrice
    Label9.Caption = rs!Quantity
    Picture1.Visible = False


    End Sub

    I put an if statement so if the selling price is null, it will won't be displayed. But it always read the null and it errors. 

    Debug line : Label8.Caption = rs!SellingPrice

    Run time error '94':

    Invalid us of Null

    Please help me.

    • Moved by Mike Feng Friday, February 15, 2013 9:56 AM
    Monday, February 11, 2013 2:35 PM

Answers

  • Hello,

    For VB6 issues please see at the top of this forum "Where to post VB6 questions" as this forum is for VB.NET.


    kevininstructor

    • Proposed as answer by Cor Ligthert Monday, February 11, 2013 2:54 PM
    • Marked as answer by Just Karl Wednesday, October 2, 2013 10:09 PM
    Monday, February 11, 2013 2:43 PM

All replies