Question : MS Access Extended list - selections from saved list

Hi

I have an extended list box containing a number of items.  I want to be able reselect items in the list box from a saved list - ie the saved list has ID's 1, 7 & 9 so when a reload button is pressed the items for these ID's are automatically selected.

What is the best way of doing this

Many thanks

Answer : MS Access Extended list - selections from saved list

How in the list saved? If in a table you can use this (Index is the column number of the ID in the listbox with 0 (zero) for the first column):

Dim I As Integer

With YourListBoxName
For I = 0 To .ListCount - 1
   If DCount ("AnyFieldNameInTable","TableName"."IDFieldName =" & .Column(Index, I) Then .Selected(I) = True Else .Selected(I) = False
Next I
Random Solutions  
 
programming4us programming4us