working on a project that calculates an amount due for an order. My problem i am facing is in regard to my clear button. The clear button will clear the fields for the current order and let you place another order that will allow the summary button to add up the totals of the orders and add sales tax, shipping and handling and total amount due. This is what I have for my clear button but for some reason, it's not adding my totals....any insight on what I am doing wrong?
Private Sub clearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clearButton.Click
Dim returnDialogResult As DialogResult
Dim messageString As String
With Me
'confirm clear of current order.
messageString = "Clear the current order figures?"
returnDialogResult = MessageBox.Show(messageString, "Clear Order", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
If returnDialogResult = DialogResult.Yes Then 'User said yes.
'Clear the screen fields.
.descriptionTextBox.Clear()
.quantityTextBox.Clear()
.weightTextBox.Clear()
.priceTextBox.Clear()
.dollaramtTextBox.Clear()
Try
'add to Totals
'add only if not a new order/customer
If sumdollaramtDecimal > 0 Then
sumdollaramtDecimal += dollaramtDecimal
'Reset totals for next customer
dollaramtDecimal = 0
End If
Catch
messageString = "Error in calculations"
MessageBox.Show(messageString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End If
End With
End Sub