Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15483

VS 2017 Details shown always first

$
0
0
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

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

Thanks guys for your future inputs. sorry super beginner

Viewing all articles
Browse latest Browse all 15483

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>