I have a listbox in access form. it contains 18 items . How do i store those itmes into array using access vba.
The following will pull the contents of a listbox into an array and spit back out the contents.
Dim Size As Integer
Size = Me.List0.ListCount - 1
ReDim ListBoxContents(0 To Size) As String
Dim i As Integer
For i = 0 To Size
ListBoxContents(i) = Me.List0.ItemData(i)
Next i
For i = 0 To Size
MsgBox ListBoxContents(i)
Next i
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With