We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,949 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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
2
Contributors
1
Reply
6 Hours
Discussion Span
1 Year Ago
Last Updated
2
Views
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

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0752 seconds using 2.65MB