S
staspe
Put Result from query in Array; then take data from array and place in
listbox on userform
Dim w As Long
Dim k As Long
rs.MoveLast
w = rs.RecordCount
rs.MoveFirst
k = 0
frmList.ListBox1.ColumnCount = 2
Do Until rs.EOF
frmList.ListBox1.List(k, 0) = rs.Fields(0)
frmList.ListBox1.AddItem rs.Fields(0)
frmList.ListBox1.List(k, 1) = rs.Fields(1)
frmList.ListBox1.AddItem rs.Fields(1)
k = k + 1
If k = w Then
frmList.Show vbModal ' <============== show me a form
holding the data containing more than one record.
Else
rs.MoveNext
End If
Loop
But it is still returning
first 4 are correct
31248 barnes
31243 barnes
31245 barnes
31243 msc
31248 <-------------- these are not
barnes
31243
barnes
31245
barnes
31243
msc
Thanks
fordraiders
listbox on userform
Dim w As Long
Dim k As Long
rs.MoveLast
w = rs.RecordCount
rs.MoveFirst
k = 0
frmList.ListBox1.ColumnCount = 2
Do Until rs.EOF
frmList.ListBox1.List(k, 0) = rs.Fields(0)
frmList.ListBox1.AddItem rs.Fields(0)
frmList.ListBox1.List(k, 1) = rs.Fields(1)
frmList.ListBox1.AddItem rs.Fields(1)
k = k + 1
If k = w Then
frmList.Show vbModal ' <============== show me a form
holding the data containing more than one record.
Else
rs.MoveNext
End If
Loop
But it is still returning
first 4 are correct
31248 barnes
31243 barnes
31245 barnes
31243 msc
31248 <-------------- these are not
barnes
31243
barnes
31245
barnes
31243
msc
Thanks
fordraiders