modifying listbox rowsource in three list boxes

S

Steve

Greetings:

I have three list boxes (lbx1, lbx2, lbx3) on frmForm. Selecting a record in
lbx1 determines the rowsource for lbx2 using the AfterUpdate event in lbx1 to
requery lbx2. The rowsource query for lbx2 makes reference to lbx1. In turn,
the rowsource for lbx3 is determined in the same manner using lbx2. This all
works fine. The problem arises when I go back and reselect something else in
lbx1, only lbx2 is updated. lbx3 still displays whatever was selected before
I made a new selection in lbx1. How do I keep lbx3 current in this situation.
Ideally, I guess, upon making a selection in lbx1, I would have, by default,
the first record in lbx2 highlighted and the relevent information to that
record displayed in lbx3. Alternatively, I could set the visible property of
lbx3 to false until the user clicks lbx2.

Any suggestions on the best way to accomplish this would be much appreciated.
 
K

Ken Snell MVP

I would have lbx3 be "nonselected" in this situation. So modify your
AfterUpdate code for lbx1 to requery both lbx2 and lbx3, in that order.
 

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