Hi Sirs,
I would like to ask what is my error in this code? i am trying to display the details of the total quantity of Labeler and Ballpen whenever selected from the combo box. But if i chose the labeler it will show the total quantity of Ballpen always. since it is the first detail in the access database
Thanks guys for your future inputs. sorry super beginner
I would like to ask what is my error in this code? i am trying to display the details of the total quantity of Labeler and Ballpen whenever selected from the combo box. But if i chose the labeler it will show the total quantity of Ballpen always. since it is the first detail in the access database
Code:
Private Sub cmbItem_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbItem.SelectedIndexChanged
Sup.Open("Select*from Supply", database)
If cmbItem.Text = "Labeler" Then
txtCurrent.Text = Sup.Fields("Supply_Quantity").Value
txtItemCode.Text = Sup.Fields("Item_Number").Value
End If
If cmbItem.Text = "Ballpen" Then
txtCurrent.Text = Sup.Fields("Supply_Quantity").Value
txtItemCode.Text = Sup.Fields("Item_Number").Value
End If