Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21238

Invalid use of Null

$
0
0
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 won't be displayed. But it always read the null and it errors.

Debug line : Label8.Caption = rs!SellingPrice

Run time error '94':

Invalid use of Null

Please help me.

Viewing all articles
Browse latest Browse all 21238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>