Private Sub lstDescriptions_Click(sender As Object, e As EventArgs) Handles lstDescriptions.Click

 

 

        txtSearch.Select()

 

        Dim IndividualCoin As XmlNode

        Dim root As XmlNode = doc.DocumentElement

        Dim xpathTarget As String

        xpathTarget = "descendant::singlecoinentry[description='" & lstDescriptions.SelectedItem & "']"

 

        IndividualCoin = root.SelectSingleNode(xpathTarget)

 

        notes.Text = IndividualCoin.SelectSingleNode("notes").InnerText

        dateofpurchase.Text = IndividualCoin.SelectSingleNode("dateofpurchase").InnerText

        purchaseprice.Text = IndividualCoin.SelectSingleNode("purchaseprice").InnerText

        dateofsale.Text = IndividualCoin.SelectSingleNode("dateofsale").InnerText

        saleprice.Text = IndividualCoin.SelectSingleNode("saleprice").InnerText

        grade.Text = IndividualCoin.SelectSingleNode("grade").InnerText

        country.Text = IndividualCoin.SelectSingleNode("country").InnerText

        year.Text = IndividualCoin.SelectSingleNode("year").InnerText

        mintmark.Text = IndividualCoin.SelectSingleNode("mintmark").InnerText

        variety.Text = IndividualCoin.SelectSingleNode("variety").InnerText

        denomination.Text = IndividualCoin.SelectSingleNode("denomination").InnerText

        quantity.Text = IndividualCoin.SelectSingleNode("quantity").InnerText

 

        Dim PicturePath As String = "C:\xml L12 Finished\coin collection\" & "coinpicture" & lstDescriptions.SelectedIndex + 1.ToString & ".png"

 

        If My.Computer.FileSystem.FileExists(PicturePath) Then

            PictureBox1.Load(PicturePath)

        Else

            PictureBox1.Image = Nothing

        End If

 

    End Sub