问题
I have a listbox in access form. it contains 18 items . How do i store those itmes into array using access vba.
回答1:
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
来源:https://stackoverflow.com/questions/23278420/getting-listbox-items-to-array-using-access-vba