G
Guest
Hello All
My connection is working fine but I cannot populate my list box. When in debug mode I can see that I am looping through the table and I see all the values for myparent = rst.Fields("Parent_ID") but the list box doesn't populate. I have tried changing the RowSourceType from Table/Query to Value List and Field List. Only when the RowSourceType is set to Value List does something appear. However, only one value appears in the List Box from the table when I know there should be a lot more. I don't understand the problem. I would appreciate any help. Thanks in advance!
Dim con As ADODB.Connectio
Dim conString As Strin
Dim strSql_Parent As Strin
strSql_Parent = "SELECT Parent_ID FROM study_design
Set con = New ADODB.Connectio
conString = "Driver={SQL Server};Server=mgarg;DataBase=hello;Uid=;Pwd=;
con.connectionstring = conStrin
con.Ope
Set rst = New ADODB.Recordse
rst.Open strSql_Parent, con, adOpenForwardOnly, adLockReadOnly, adCmdTex
rst.MoveFirs
'Begin loo
Do While Not rst.EO
'Set myparent equal to the Parent_ID field of the Study_Design tabl
myparent = rst.Fields("Parent_ID"
List0.RowSource = myparen
Loo
rst.MoveNex
End Su
My connection is working fine but I cannot populate my list box. When in debug mode I can see that I am looping through the table and I see all the values for myparent = rst.Fields("Parent_ID") but the list box doesn't populate. I have tried changing the RowSourceType from Table/Query to Value List and Field List. Only when the RowSourceType is set to Value List does something appear. However, only one value appears in the List Box from the table when I know there should be a lot more. I don't understand the problem. I would appreciate any help. Thanks in advance!
Dim con As ADODB.Connectio
Dim conString As Strin
Dim strSql_Parent As Strin
strSql_Parent = "SELECT Parent_ID FROM study_design
Set con = New ADODB.Connectio
conString = "Driver={SQL Server};Server=mgarg;DataBase=hello;Uid=;Pwd=;
con.connectionstring = conStrin
con.Ope
Set rst = New ADODB.Recordse
rst.Open strSql_Parent, con, adOpenForwardOnly, adLockReadOnly, adCmdTex
rst.MoveFirs
'Begin loo
Do While Not rst.EO
'Set myparent equal to the Parent_ID field of the Study_Design tabl
myparent = rst.Fields("Parent_ID"
List0.RowSource = myparen
Loo
rst.MoveNex
End Su