Hi,
I have a function which receives a control name (as a a string) within the function parameter. I wish to use that string name and use the additem to add data to that name.

I thought it was possible with the Eval method I have come across before in MS Access. However, I have had no luck in my version of VB6 Enterprise (SP4). I get errors trying to use the Eval method. Is there an alternative to his, or is my code structured wrong.

Any help much appreciated,

Russ

My code looks like this:

Private Function PopulateBox(RS As ADODB.Recordset, str As String) As Boolean

If RS.RecordCount = 0 Then
PopulateBox = False
Else
Do Until RS.EOF = True
' NEXT LINE DOESN'T WORK!!!
eval(str & ".AddItem " & RS!Desc)
RS.MoveNext
Loop
PopulateBox = True
End If

End Function