Move Item Between List Boxes

E

el zorro

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!
 
M

mike

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] )
 
Top