I do not know which control you are using however, you will probably either set
the control source to the recordset or, as I would do, loop through the
recordset and use additem to add the row to the control. See code below for an
example. Please post again to let me know if it works or not. this code adds
values to a combo box.
Private Function cboAnalysisLoad(cboDatabase As String)
Dim strParam As String
ConnectDB
Set objSourceRS = New ADODB.Recordset
With objSourceRS
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockBatchOptimistic
.ActiveConnection = objConn
End With
gstrSQL = "SELECT Name, Description, Rundate, ID FROM " & cboDatabase &
".dbo.RDM_ANALYSIS RDM_ANALYSIS WHERE EXPOSURETYPE in (8017,8029) ORDER BY Name,
Rundate"
objSourceRS.Open gstrSQL
With cboAnalysis
.Clear
Do While Not objSourceRS.EOF
.AddItem objSourceRS.Fields("Name").Value
.List(0, 1) = objSourceRS.Fields("Description").Value
.List(0, 2) = objSourceRS.Fields("Rundate").Value
.List(0, 3) = objSourceRS.Fields("ID").Value
objSourceRS.MoveNext
Loop
End With
objSourceRS.Close
End Function