...Does the fact that they are extended selection listboxes make a difference...
In the middle of watching Jeopardy, a short while ago, this comment came back to me, and the answer is, of course it does!
When the
Multi-Select Property of a
Listbox is set to anything other than '
None,' the
Listbox has
no Value Property. That's why you have to loop through all possible selections to determine which ones have actually been selected. And because
there is no single selection, the
Listbox cannot really have a
Control Source. You can have one listed, in the
Properties Pane, but that only applies if
Multi-Select is set to '
None.' Because of this,
Multi-Select Listboxes are actually
Unbound and thus there is no way,
using the Listbox, to have the
Formatting be
appropriate as you move from
Record-to-Record. You can see the truth of this by making a
selection or selections from the
Listbox, then moving to
another Record; the
Listbox will still show the
selection(s) that were made in the
Previous Record, which is the
usual behavior of an
Unbound Control.
You can use the code I gave you in the
TypeOfBusiness_AfterUpdate event, and it will immediately make the
IndustryClassification Listbox
Visible, if '
Industry' is selected, but the
Formatting will not stay
appropriate when moving to
another Record. In order to maintain the
appropriateness of
Formatting, when moving from
Record-to-Record, the selection of '
Industry' has to be in a
Bound Control. When you
move to another Record, you check that
Bound Control, and set the
Formatting based on whether or not '
Industry' is the
Control. You can do this, but it will be more complicated.
To summerize:
- In TypeOfBusiness_AfterUpdate, you need to Loop through the Listbox Selections and make the IndustryClassification Listbox Visible/Invisible, dependent on whether 'Industry' was selected (using the code I gave you for this)
- Loop through the Listbox, again, and assign each selection made to a single Bound Textbox, each one separated by a delimiter, such as a comma or semi-colon
- In the Form_Current event, use the Instr() Function to ascertain whether 'Industry' is found in the concatenated value held by the new Textbox, and Format the Visibility of IndustryClassification appropriately
You can work on this, and see how it comes along; maybe you can get it working from the summary above. If not, I'll stop back by in the morning and help you with it.
Linq
;0>