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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box problem

Status
Not open for further replies.

jpinto

Technical User
Dec 12, 2003
75
PT
I've a combo box on a form that is binded to an Access table.

For instance, lets say the combo displays "White", "Yellow", "Red" (on this order)
I open the drop down list and I select "Red". When I open the drop down list again, the combo displays ""Red", "Yellow" and "Red"!

What can be the problem? I'm new on VB .NET. On VB6 I didn't had that problem.

Tanks in advance.

João Pinto
 
Perhaps you could show some code related to the combo box to see what's the error..
 
Clear the items before you refill the combo
Code:
        With Me.ComboBox1
            [b].Items.Clear()[/b]
            .Items.Add("Blue")
            .Items.Add("Green")
            .Items.Add("Red")
        End With

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
Hello ZmrAbdulla,

The combo box is really bound to a dataset. On the form Load event I've:

Code:
Me.DesignacoesTableAdapter.Fill Me.ScrapDataSet.designacoes)

DesignacaoCombo.SelectedIndex = -1

When I select one of the items, and open the drop down list again, that item is the first of the list!

Can you help me please?

Thank,

João Pinto
 
Please, can annyone help me?

Thanks,

João Pinto
 
I would guess that some how the first item of the look-up dataset is getting set to the value that is selected.

Make sure that you are not modifying the datatable that the combo box is bound to.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top