S
SirPoonga
I am trying to output some data from a SQL query to a list box control
in Access.
My listbox is named listNames. When I try the following code I get an
error message on the line with '***. The message says "Run-time error
'424' Object Required"
sqlcmd = "SELECT First, Last " & _
"FROM Names"
rs2.Open sqlcmd, CurrentProject.Connection
If Not rs2.EOF Then rs2.MoveFirst
ii = 0
Do While Not rs2.EOF
listNames.Column(0, ii) = rs2.Fields(0) '***
listNames.Column(1, ii) = rs2.Fields(1)
rs2.MoveNext
ii = ii + 1
Loop
rs2.Close
in Access.
My listbox is named listNames. When I try the following code I get an
error message on the line with '***. The message says "Run-time error
'424' Object Required"
sqlcmd = "SELECT First, Last " & _
"FROM Names"
rs2.Open sqlcmd, CurrentProject.Connection
If Not rs2.EOF Then rs2.MoveFirst
ii = 0
Do While Not rs2.EOF
listNames.Column(0, ii) = rs2.Fields(0) '***
listNames.Column(1, ii) = rs2.Fields(1)
rs2.MoveNext
ii = ii + 1
Loop
rs2.Close