0

I've fought the Error 91 problem for years programing (self taught) in VB 6. Below is a simple example of a program getting data from a database and putting it into a grid. I know I'm supposed to use Dim and Set statements, but I've never figured it out. Can you help me??

Private Sub FormLoad()

    Data1.Recordset.MoveFirst
    R = 1: grdData.Col = 0

    Do Until Data1.Recordset.EOF = True
       grdData.Row = R
       grdData.Text = Data1.Recordset.Fields("Name")
       R = R + 1
       Data1.Recordset.MoveNext
    Loop

End Sub

Edited by Reverend Jim: fixed formatting

1
Contributor
0
Replies
12
Views
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.