loop thro a access list box

  • Thread starter Thread starter Chris Murray
  • Start date Start date
C

Chris Murray

How can I loop thro a list box and add each entry to a var. I have been
trying now for what seems like hours and I just cant crack it.


visual basic
code:------------------------------------------------------------------------------

For n = 1 To Order!Basket.ListCount

Shopping = Shopping & Order!Basket.List(n - 1)
Next n

------------------------------------------------------------------------------

the above code works fine in Excel but in access the list box seems to be
missing the .list attribute.

please any words of advise

thanks Chris
 
Chris said:
How can I loop thro a list box and add each entry to a var. I have been
trying now for what seems like hours and I just cant crack it.


visual basic
code:------------------------------------------------------------------------------

For n = 1 To Order!Basket.ListCount

Shopping = Shopping & Order!Basket.List(n - 1)
Next n


For List and Combo boxes, you need to use the ItemData
property to retrieve the bound column's value.

There's also the Columns property that allows you to get to
any row/column in their row source.
 
Back
Top