Cannot seem to make the message box to not appear when I click cancel. Help please !
Private Sub btnEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnter.Click
Dim input As String
Dim total As Single
Dim average As Single
Dim count As Single
Const msg1 As String = "Enter a sales amount. Click Cancel to end"
Const msg2 As String = "Sales Entry"
count = 1
Do
input = InputBox(msg1, msg2)
If Not IsNumeric(input) Then
MessageBox.Show("Error, please check input")
Else
count = count + 1
total = total + input
End If
Loop Until (IsNumeric(input) And count > 5)
lblTotalSales.Text = total.ToString("C2")
average = total / 5
lblAverage.Text = average.ToString("C2")
End Sub