Selecting Multiple Items on a ListBox

A

Administrator

I am helping a non profit organization create a contact database. The only
issue i am having is if the contacts have multiple events to attend. I
create a listbox and allowed extended in its allow multiple values, but they
are not being stored in the table. please help
 
J

Jeff Boyce

Why would they be? Simply selecting multiple listbox items doesn't cause
Access to do anything with them.

And if you have that listbox bound to an underlying field, how were you
figuring to get the multiple-selected items stored in that field?

"How" really depends on "what", and you haven't describe what data structure
you are using.

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
K

KC-Mass

Once they are selected you have to work with the "ItemsSelected"

The below is directly from the help file. Where they print the data you
will want to store the data.
You will also obviously have to change the code to address your forms,
fields, etc

Sub BoundData()
Dim frm As Form, ctl As Control
Dim varItm As Variant

Set frm = Forms!Contacts
Set ctl = frm!Names
For Each varItm In ctl.ItemsSelected
Debug.Print ctl.ItemData(varItm)
Next varItm
End Sub

Regards

Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top