Move Item Between List Boxes

G

Guest

I have 2 List Boxes on a Form A, List A and List B.

The user can select an item from List A, then open Form B for that item to
add data. WHen Form B is closed, the item now appears in List B (based on the
underlying query for List B). So far so good.

I would like the Item to then disappear from List A-- esentially. giving the
appearance the it has moved from List A to List B. I can't see how to do it
via the underlying query for List A, so let's assume that is not an option.

Is there a VBA way to make List A read List B (say, maybe in the On Close
event for Form B, or during the On Update event for List B) and omit items on
List B?

As always, your help is most appreciated!
 
G

Guest

One way would be to alter the query for List A so that the WHERE clause
excludes the selection criteria you used to populate List B -- if you go this
route I suggest using the IN clause (or in this case, NOT IN).

For example,

SELECT FieldA FROM TableA WHERE FieldA NOT IN ( [Query for List B] )
 

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