Hi All,
I want to open up a form and on-load have a multi select listbox have its values already selected based on a table/recordsets values.
I think I need to loop through both the recordset and the listbox but im not sure on the correct code.
My failed attempt,
This doesnt find the Task_ID so how do I correctly loop through the a particular recordsets values?
Thanks.
Sent from my SM-G965F using Tapatalk
I want to open up a form and on-load have a multi select listbox have its values already selected based on a table/recordsets values.
I think I need to loop through both the recordset and the listbox but im not sure on the correct code.
My failed attempt,
Code:
For Each varItem in rs2.fields(Task_ID)
For i = 0 to Me.TaskSelection.ListCount -1
If Me.TaskSelection.ItemData(i) = varItem Then
Me.TaskSelection.Selected(i) = True
End if
Next i
Next varItem
This doesnt find the Task_ID so how do I correctly loop through the a particular recordsets values?
Thanks.
Sent from my SM-G965F using Tapatalk