Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi-Select Listbox has items preselected

Status
Not open for further replies.

grannyM

Programmer
Nov 26, 2002
39
0
0
US
I am creating a MultiSelect listbox in Word 2003 and when the listbox is displayed, some of the items in the listbox are preselected and I have not been able to find out why. I do not want anything preselected. In my main module I have the following code:

Code:
     For i = 1 to FundNumber
        FundForm.ListBox1.AddItem i
        FundForm.ListBox1.List(i - 1, 1) = MFLFundName(i)
        FundForm.ListBox1.List(i - 1, 2) = MFLTicker(i)
        FundForm.ListBox1.List(i - 1, 3) = MFLShareClass(i)
        FundForm.ListBox1.List(i - 1, 4) = FundNote(i)
     Next i

    FundForm.ListBox1.MultiSelect = fmMultiSelectMulti
    FundForm.Show

And the form always opens with at least 2 items in the list already selected. I have tried adding the following line right after the additem line, as the last line in the loop, and in the form initialze sub, but it still shows the items selected.

Code:
     FundForm.ListBox1.Selected(i - 1) = False

One quirk I have noticed, if I step through the code line-by-line, it works correctly. But if I run through it, it displays with some items preselected.

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top