Hello to all im trying to create a simple code thats not soo simple to me but i just wanted to know if someone would be so kind as to help me figure out why certain things are not going as planned. Please have in mind i am a beginner (be gentle ). My code is the following (I put what i need help with in the code. its in green):

Code:
Imports System.IO
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim pInventory As IO.StreamWriter = IO.File.AppendText("product.txt")
        If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Then
            MsgBox("Please fill in required fields", MsgBoxStyle.Exclamation, "Error")
        Else
            pInventory.WriteLine(TextBox1.Text & ", $" & TextBox2.Text & ", " & TextBox3.Text)
            TextBox1.Clear()
            TextBox2.Clear()
            TextBox3.Clear()
            Dim num As Integer
            For num = 0 To ListBox1.Items.Count - 1
                pInventory.WriteLine(ListBox1.Items(num))
            Next
            pInventory.Close()
        End If
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim name As String
        Dim num As Integer
        Dim max As Integer
        name = InputBox("What item would you like to search for :", "Product Search")
        num = 0
        max = ListBox1.Items.Count - 1

        'Here im having trouble searching for a product that is entered/saved in the data entry
        'it tells me that the exception was unhandled. it says its an invalid argument

        Do While (name <> (ListBox1.Items.Item(num))) And (num < max)
            num = num + 1

            ListBox1.Items.Add(num)
        Loop
        If (name = ListBox1.Items.Item(num)) Then
            MsgBox(name & " Was found", , "Search")
        Else
            MsgBox(name & " Was not found", , "Search")
        End If
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If ListBox1.SelectedIndex <> -1 Then
            ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
        Else
            MsgBox("Please make a selection")
        End If
    End Sub
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

       'Here, when you click on the "view data" button i just want the archive to show everything entered in data entry
        'but i just cant seem how to do it to where it just displays the data instead of asking you to enter archive name
        'i think im just worn out with this project!

        Dim item As String
        Dim product As StreamReader
        item = InputBox("Please enter archive name", "Product List")
        item = item & ".txt"
        If File.Exists(item) Then
            product = File.OpenText(item)
            ListBox1.Items.Clear()
            Do While product.Peek <> -1
                ListBox1.Items.Add(product.ReadLine)
            Loop
            product.Close()
        Else
            MsgBox("Archive does not exist!", MsgBoxStyle.Critical, "Error")
        End If
    End Sub
End Class