I'm not sure where is your problem, but I hope this will satisfy your requirements.
This line is to remove redundancy from your code, so you don't have to write validation twice:
ElseIf CheckRadioButton.Checked = True OR ChargeRadioButton.Checked = True Then
The next part is to check whether he is eligible to withdraw this amount from his account or not, if not then stop him and exit the function so the GUI or DB doesn't get affected!
IF (BalanceDecimal - AmountDecimal > 0 ) THEN
BalanceDecimal -= AmountDecimal
ELSE
'SHOW YOUR MESSAGE HERE
EXIT
It is basiclly what you asked in the question but translated into code, nothing tricky just simple logic :))
Private Sub CalculateTextBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculateTextBox.Click
'Calculate the transaction and display the new balance
Dim AmountDecimal As Decimal
If DepositRadioButton.Checked Or CheckRadioButton.Checked Or ChargeRadioButton.Checked Then
Try
AmountDecimal = Decimal.Parse(AmountTextBox.Text)
If DepositRadioButton.Checked = True Then
BalanceDecimal += AmountDecimal
ElseIf CheckRadioButton.Checked = True OR ChargeRadioButton.Checked = True Then
IF (BalanceDecimal - AmountDecimal > 0 ) THEN
BalanceDecimal -= AmountDecimal
ELSE
'SHOW YOUR MESSAGE HERE
EXIT
END IF
END IF
BalanceTextBox.Text = BalanceDecimal.ToString("C")
Catch AmountException As FormatException
MessageBox.Show("Please make sure that only numeric data has been entered.",
"Invalid Entry", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
With AmountTextBox
.Focus()
.SelectAll()
End With
Catch AnyException As Exception
MessageBox.Show("Error: " & AnyException.Message)
End Try
Else
MessageBox.Show("Please select deposit, check, or service charge", "Input needed")
End If
End Sub