Two list-box selection on a form

A

ascagnel

I'm looking to create a form where the user selects multiple items
from a list. After the items are selected, the user should be able to
view the unselected items as well as the selected items. The number
and values of the items will be drawn from a table.

I figure the best way to do this is to recreate the interface of some
of the wizards in access, specifically the ones where a list of tables
and queries is presented for building a form or report.

Is this included as a standard control? What would be the best way to
go about creating this double list?
 
J

Jeff Boyce

I'm not aware of a particular control (but hey, there's a lot out there!).

When I've created this kind of paired listbox interface, I have one table
(notice, tables, not forms yet) that holds the "Available" items and one
table that holds the "SelectedByThisEntitiy" items (I assume you're trying
to associate up to multiple items with a particular entity/ID).

I use a query to display the "items related to this entity" in the
"Selected" listbox, and I use a query that returns "available items NOT
already selected by this entity" for the "Available" listbox.

Then I add some command buttons to "move" items back and forth between the
boxes. The code behind these buttons simply adds or removes items from the
"SelectedByThisEntity" table, then requery the listboxes.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
A

ascagnel

I combined your idea with an article on MSDN on creating paired
listboxes and was able to create a fully functional form.

Thank you very much!
 

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