Mediocre Egg
02-11-2008, 01:15 PM
I have something simple in mind but I can't figure out how to execute the idea. I looked on Google a bit and found things close to what I need but not close enough that I was able to come away with a solution. I am only a VBA hobbyist so this is probably very basic.
I have a userform with three controls: textbox (txtCost), button (cmdAdd), label (lblTotalCharge).
My goal is to have lblTotalCharge keep a running total of the amounts entered in txtCost and upon submitting the form, dump the total into a bookmark on my Word document.
The first thing I did was place this in Private Sub txtCost_Change():
lblTotalCharge.Caption = txtCost.Value
But once I have lblTotalCharge displaying the cost, I need a way to store it and add it to the next number entered into txtCost.
I figured the way to do this would be to set a variable equal to lblTotalCharge but I can't seem to get my head around what needs to come next.
Can anyone point me in the right direction?
I have a userform with three controls: textbox (txtCost), button (cmdAdd), label (lblTotalCharge).
My goal is to have lblTotalCharge keep a running total of the amounts entered in txtCost and upon submitting the form, dump the total into a bookmark on my Word document.
The first thing I did was place this in Private Sub txtCost_Change():
lblTotalCharge.Caption = txtCost.Value
But once I have lblTotalCharge displaying the cost, I need a way to store it and add it to the next number entered into txtCost.
I figured the way to do this would be to set a variable equal to lblTotalCharge but I can't seem to get my head around what needs to come next.
Can anyone point me in the right direction?