Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,574 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,879 people online right now. Registration is fast and FREE... Join Now!




ComboBox Help

 
Reply to this topicStart new topic

ComboBox Help

SSGHT
4 Apr, 2008 - 10:22 AM
Post #1

New D.I.C Head
*

Joined: 4 Apr, 2008
Posts: 2

Hi, i'm pretty new to proggraming and this task is probably really simple so sorry.

Well i am trying to edit the cost of a selected item this is part of a homework assignment by the way. Well i would like to select the item from the combo box and then type the new price for the item in a text box and by pressing a command button the new price will be displayed in the label

CODE
Private Sub Form_Load()
    cboEditCost.AddItem "Bread"
    cboEditCost.AddItem "Milk"
End Sub

Private Sub cmdEditCost_Click()
    If cboEditCost.Text = "Bread" Then
        lblPriceBread = Val(txtEditCost)
    ElseIf cboEditCost.Text = "Milk" Then
        lblPriceMilk = Val(txtEditCost)
    End If
End Sub


The problem i think i'm having is recognising the item from the combo box any help will be much appreciated.

Thank You S.S.GHT
User is offlineProfile CardPM
+Quote Post

SSGHT
RE: ComboBox Help
4 Apr, 2008 - 11:18 AM
Post #2

New D.I.C Head
*

Joined: 4 Apr, 2008
Posts: 2

I've fixed my problem
I needed to use .ListIndex rather .Text, renumber the ItemData from the properties window and then swap the item name with the corresponding number.

Sorry :[

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 12:06AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month