Selecting multiple items from a table

S

s0h0us

I have 2 tables:
table1= userid, first, last
table2= widgets

i would like to create a form that will let me pull down and select the user
from a list, then below it have a list of widgets from which i can select
more than one widget, click and add button and assigned those selected
widgets to the corresponding user. not sure if that makes sense

user name: (pulldown list)


Select Widgets: Widgets for
this user:
widget1
widget2 Add >>
widget 3 <<Remove
 
P

pietlinden

s0h0us said:
I have 2 tables:
table1= userid, first, last
table2= widgets

i would like to create a form that will let me pull down and select the user
from a list, then below it have a list of widgets from which i can select
more than one widget, click and add button and assigned those selected
widgets to the corresponding user. not sure if that makes sense

user name: (pulldown list)


Select Widgets: Widgets for
this user:
widget1
widget2 Add >>
widget 3 <<Remove

You're describing manipulating listboxes. If you have Access 2002 or
later, you can use the AddItem and RemoveItem methods of the listbox
control. You would have to loop through the ItemsSelected collection
to add them to the destination listbox and then remove them from the
source listbox. It may not be an ideal solution, because then you
still have to write the final set to a table, since you can't bind a
multi-select listbox to a field in your form's underlying rowsource.
So you're forced to loop through the items. There's code at AccessWeb
for this.
IIRC, it's something like

dim varItem as Variant
for each varItem in lbxSrc.ItemsSelected
'---process item
next varitem
 

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