Unanswered: Cannot Get ListBox .ItemsSelected, help!
i am unable to retrieve .ItemsSelected of a multiselect listbox on a form.
1. the form is visible
2. i manually select some items in the listbox.
3. then in VBA i get the .ItemsSelected.Count property of the listbox.
4. ItemsSelected.Count returns 0. This is a bug?
5. i can clearly see items selected in the listbox.
What's the problem?
i am loading several forms in Hidden mode.
then i make only one form visible at a time by VBA.
if i open this one form by itself, with no other forms loaded, then i am able to retrieve .ItemsSelected.Count value correctly.
"If the form isn't loaded when you make this reference to its class module, Access will load a hidden copy of the form and add it to the Forms collection."
"remove all uses of Form_<form name> and replace them with the canonical usage:
'DoCmd.OpenForm "FormName"' instead of 'Form_FormName.Visible = True'
'Forms!FormName.ControlName' or 'Forms("FormName").ControlName' instead of Form_FormName.ControlName
'DoCmd.SelectObject "FormName"' instead of Form_FormName.SetFocus