A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Cascading Listboxes feeding off each other



 
 
Thread Tools Display Modes
  #1  
Old March 19th, 2010, 07:51 PM posted to microsoft.public.access
Robbro
external usenet poster
 
Posts: 82
Default Cascading Listboxes feeding off each other

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

  #2  
Old March 20th, 2010, 02:34 PM posted to microsoft.public.access
John Spencer
external usenet poster
 
Posts: 7,815
Default Cascading Listboxes feeding off each other

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

Robbro wrote:
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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:01 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.