0

Hello there guys!

Need you expertise run time error: '91': Object Variable or with block variable not set. I got the syntax in Do while not .EOF statement. Thanks in advance!

Private Sub Form_Load()

With adVideos.Recordset

    cmbCategory.Clear
    
    Dim i As Integer
    Dim st As String
    Dim b As Boolean
    
    cmbCategory.AddItem "All"
    
    Do While Not .EOF
    
        st = .Fields!Category
        b = False
        
        For i = 0 To cmbCategory.ListCount - 1
        
            If st = cmbCategory.List(i) Then
            b = True
        End If
    Next
    
        If b = False Then
            cmbCategory.AddItem st
        End If
        
    .MoveNext
    
    Loop
    
End With

If cmbCategory.ListCount > 0 Then

    cmbCategory.ListIndex = 0
Else

    cmbCategory.ListIndex = -1
End If

cmdLend.Visible = False
cmdReserve.Visible = False

LoadRecs

End Sub
2
Contributors
1
Reply
4
Views
5 Years
Discussion Span
Last Post by Jx_Man
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.