PDA

Click to See Complete Forum and Search --> : Combo box


EscapeUK
Jun 15th, 2000, 01:11 AM
Urgent help needed here

I have a recorset containing 2 cols of data 1D, and desc
how do i populate a combo box with the send coloumn?


thanks

JHausmann
Jun 15th, 2000, 01:41 AM
Following is for a listbox, modify it accordingly.


Dim rsTmp As Recordset
Dim nLoop As Integer
Dim sListStr As String



frmMain.lstData(1).Clear 'dont want none of that bad data


Set rsTmp = database.OpenRecordset("SQL command", dbOpenSnapshot)


If rsTmp.EOF = False Then 'we collect the entries from the table
Do While Not rsTmp.EOF
sListStr = Format(rsTmp.Fields(1), "")
frmMain.lstData(1).AddItem sListStr, nLoop
nLoop = nLoop + 1
rsTmp.MoveNext
Loop
rsTmp.Close
End If

End Sub