Run time error '94' Invalid use of Null
Hello there need your expertise i got the run time error invalid use of null in line number 19. Thanks in advance
Private Sub Form_Load()
Dim oRS As New classRecordset
Set rsLibrary = oRS.CurrentRS(Books)
Set rsTrans = oRS.CurrentRS(Reserved)
With rsLibrary
Combo1.Clear
Dim i As Integer
Dim st As String
Dim b As Boolean
Combo1.AddItem "All"
Do While Not .EOF
st = .Fields!Category
b = False
For i = 0 To Combo1.ListCount
If st = Combo1.List(i) Then
b = True
Exit For
End If
Next
If b = False Then
Combo1.AddItem ep
End If
.MoveNext
Loop
End With
lv.ColumnHeaders.Item(1).Width = lv.Width * 0.75
lv.ColumnHeaders.Item(2).Width = lv.Width * 0.25
If Combo1.ListCount > 0 Then
Combo1.ListIndex = 0
Else
Combo1.ListIndex = -1
End If
End Sub
Related Article: Run-time error '380': Invalid property value?
is a solved Visual Basic 4 / 5 / 6 discussion thread by aianne that has 4 replies, was last updated 1 year ago and has been tagged with the keywords: listview, run-time-error380, visualbasic6.
dwiniers
Junior Poster in Training
57 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Most of that problem occured is when you try to retieved a data from the database.
Check if the field has the null data or not.
if not isnull(.Fields!Category) then
'[your code]
else
'[your code]
end if
Jx_Man
Senior Poster
3,527 posts since Nov 2007
Reputation Points: 1,482
Solved Threads: 515
Skill Endorsements: 64