Hey all, I'm working on a VB program that is a cashout sheet. In this sheet, there are about 23 fields where information is being input. What I am trying to do is create the program so that when the user presses tab, enter or down arrow key it goes to the next field in the tabindex and then continues to add all the fields that are associated with each of the totals textboxes.
I know that this can be done with with a button, but I don't want the user to have to click the button everytime they want to update the total field.
For example, my deposits' Totals field has the following code, am I way out in left field in thinking that this can be done "on the fly"?:
I know that this can be done with with a button, but I don't want the user to have to click the button everytime they want to update the total field.
For example, my deposits' Totals field has the following code, am I way out in left field in thinking that this can be done "on the fly"?:
Code:
Private Sub TotalsTextBox_Cursorchange(ByVal sender As Object, ByVal e As System.EventArgs) Handles TotalsTextBox.CursorChanged
Dim num1, num2, num3, num4, num5, num6, num7, num8, TotalDeposit As Decimal
num1 = Val(BDepositTextBox.Text)
num2 = Val(ChargeTextBox.Text)
num3 = Val(DebitTextBox.Text)
num4 = Val(CreditTextBox.Text)
num5 = Val(CouponsTextBox.Text)
num6 = Val(CertificatesTextBox.Text)
num7 = Val(Received_On_AccountTextBox.Text)
num8 = Val(DErrorTextBox.Text)
TotalDeposit = num1 + num2 + num3 + num4 + num5 + num6 + num7 + num8
TotalsTextBox.Text = Val(TotalDeposit)
End Sub
Comment