D
Dianne
Using Excel 97.
I have a user form with 2 single-select list boxes. The first (lstTypes)
shows a list of available Types. The second (lstDescriptions) shows the
Descriptions for the selected Type. I have a routine (ExtractCodes)
which sets values in a criteria range (lstTypes does not have a control
source) and extracts the matching data from the database.
I call the ExtractCodes routine in lstTypes_Change event. This works
well.
BUT... When I activate the userform for the first time, I would like the
first
item in lstTypes to be selected. So the UserForm Activate event sets the
ListIndex to 0 (I can see the first item is "selected" -- highlighted in
blue). This triggers the lstTypes_Change event, which runs ExtractCodes.
However, when I step through ExtractCodes, lstTypes.value = "" so the
criteria range is set to "", which means that lstDescriptions shows all
values.
Why doesn't ListIndex=0 change lstTypes.Value even though it's
triggering the Change event?
Thanks for any suggestions.
I have a user form with 2 single-select list boxes. The first (lstTypes)
shows a list of available Types. The second (lstDescriptions) shows the
Descriptions for the selected Type. I have a routine (ExtractCodes)
which sets values in a criteria range (lstTypes does not have a control
source) and extracts the matching data from the database.
I call the ExtractCodes routine in lstTypes_Change event. This works
well.
BUT... When I activate the userform for the first time, I would like the
first
item in lstTypes to be selected. So the UserForm Activate event sets the
ListIndex to 0 (I can see the first item is "selected" -- highlighted in
blue). This triggers the lstTypes_Change event, which runs ExtractCodes.
However, when I step through ExtractCodes, lstTypes.value = "" so the
criteria range is set to "", which means that lstDescriptions shows all
values.
Why doesn't ListIndex=0 change lstTypes.Value even though it's
triggering the Change event?
Thanks for any suggestions.