Cascading Listboxes feeding off each other

R

Robbro

I have 2 Multi-select list boxes on a form to filter a report, 1 for
customers, one for lots. The filter works just fine, and I finally have each
set up so that when you change 1, the other reflects only items assocaited
with your selection(s) (select a customer or customers, it shows only lots
bought by your selection, select lot or lots, shows only customers that
bought your selection, there are other date and plant selections that feed in
as well, but for now thats not relevant).

My issue is that the automatic requeries that happen when one list gets
updated from the other clears any selections made. I select Customer 1, it
shows products X, Y and Z that 1 bought, but then if I try to select Y to
show a report on Customer 1 product Y it refreshes my customer list to all
that bought Y (which is ok) but deselects my Customer choice as well. With
this setup I cannot make a choice from both the lot and customer field (which
worked fine before I experimented with this cascading now clicking one always
clears the other).
Is there anyway I can have my 2 way cascading and select from both listboxes
too?

Thanks
 
J

John Spencer

BEFORE you update the list box row source, you need to record the current
selections in an array. Then after you change the row source, you will need
to execute code that re-selects the selected items (if they exist) based on
stepping through the array.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

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