Public Class Rent

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

        txtusername.Text = ""
        txttime.Text = ""
        txttotal.Text = ""

    End Sub

    Private Sub txttime_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txttime.TextChanged

        btnsave.Show()
        'btncancel.Hide()

        Try

            txttotal.Text = txtrate.Text * txttime.Text

        Catch ex As Exception

            txttotal.Text = txtrate.Text * 0

            ' btncancel.Show()
            btnsave.Hide()

        End Try

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click

        sql_add = "INSERT INTO Table2 (UserName, TimeAdded, Rate, Total) values ('" & txtusername.Text & "' , '" & txttime.Text & "' , '" & txtrate.Text & "' ,'" & txttotal.Text & "')"

        mySQL(sql_add)

        MsgBox("New transaction has been added to your database.")

        txtusername.Text = ""
        txttime.Text = ""
        txttotal.Text = ""

        'Me.Hide()

    End Sub

    Private Sub Rent_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        btnsave.Show()
        'btncancel.Show()

    End Sub

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        customer.Show()
    End Sub
End Class