Hi all. I am using VB .NET 2005 and SQL Server 2005. I have a MultiExtended listbox that I save the ValueMember(s) to a database. The ValuMemeber(s) are saved like this:
19903 - for a single choice
19903,19904 - for a multiple choice
What I am attempting to do is reload the listbox with the original members and then based upon what is comeing back from the database reset those ValueMembers. When the data comes back from the database I am putting it into a textbox on a Main Form and then reading that textbox from my Dialog Form. Here is my code:
The problem I am facing is the code always chooses the first item in the listbox. I tried adding this line of code after the LoadDivsions() line:Code:If Main.txtDivision1.Text <> "" Then LoadDivisions() lstDivisions.SelectedItem = Main.txtDivision1.Text lstDivisions.Visible = True End If
but then nothing is chosen. I also have no real idea about how to load the multiple saved values.Code:lstDivisions.SelectedIndex = -1
Any help would be appreciated.


Reply With Quote