command button that moves items in one lsit box to another

G

gbpg

Does any one have any idea how to have two or more list boxes that can move
items back forth using command buttons?
 
O

OldPro

Does any one have any idea how to have two or more list boxes that can move
items back forth using command buttons?

Sure, there are a couple of ways to do it. The .Selected property can
be used to retreive all selected items. There is an example in the
Help. If the rowsource of the listbox is a list, then give it a new
list. Otherwise, if the rowsource is a table, then delete the record
from one table and put it in the other. Finally, refresh the
listboxes.
 
M

Morris

Sure, there are a couple of ways to do it. The .Selected property can
be used to retreive all selected items. There is an example in the
Help. If the rowsource of the listbox is a list, then give it a new
list. Otherwise, if the rowsource is a table, then delete the record
from one table and put it in the other. Finally, refresh the
listboxes.

I did it based on two tables - One lists all records and another one
is a list of 'ignored records'. Now, the Lists' recordsources are
queries which for top listbox say: 'Show me all records that are not
ignored' and bottom listbox: 'Show me all ignored records'.

And I've got two buttons which add or delete a record in the 'ignored'
table keeping the 'main' table intact.

Let me know if you need something like that.

Morris
 

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