954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Run-time error '91': Object variable or With block variable not set

Hello Daniweb :)
I am currently doing a programming assignment for college and have hit a brick wall. I am getting an error while trying to fill a combo box.

Private Sub Form_Load()

    'Fill the Network List

    With adoNetwork.Recordset
    Do Until .EOF
            If !Networks <> "" Then
                cboFilterNetwork.AddItem !Networks
            End If
            .MoveNext
        Loop
        .Close
    End With
    
End Sub


VB6 says the error is at Do Until .EOF, this code is exactly the same as a previous program we did in class, but no matter what I have done it simply will not work.

Any help at all will be appreciated

Thank you

-Seán

EDIT: Nevermind I fixed it, think the error was a simple typo, deserve it for doing college work at 4am I guess

EireJoker
Newbie Poster
4 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

Good that you have solved your problem.

kinwang2009
Posting Whiz in Training
243 posts since Feb 2010
Reputation Points: 17
Solved Threads: 42
 

With testObject
.Height = 100
.Text = "Hello, World"
.ForeColor = System.Drawing.Color.Green
.Font = New System.Drawing.Font(.Font,
System.Drawing.FontStyle.Bold)
End With

arjunad
Newbie Poster
1 post since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You