View Full Version : Another question - re multiselect


kiwi
03-12-2000, 10:25 AM
I have a Multiselect List Box set up identically to the one in the Access 97 Developers Handbook, pg 340 (A multi select box, selected items box, a count of the selected items, and a clear selections). My problem is that what ever I select on one record is the same for all the records. How can I change this so that I can select for each individual record? FYI - It is not a subform. Thanks ... Jane :-)

Travis
03-12-2000, 08:31 PM
I find it is best to add this code to the Form_Current Event of the form (when using multi-select)

Private Sub Form_Current()
Set ctl = Me.[ListBoxFieldName]
For intRow = 0 To ctl.ListCount - 1
ctl.Selected(intRow) = False
Next intRow
End Sub

What this does is unselect all of the items in a list box. Multi-Select list boxes do not actually store data. Mainly because Access does not know which to store. So you will have to go even further to populate a table to store the choosen data and If you intend to use the same form to edit the records you will need to be able to select the appropriate item.

Hope this helps.