Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Question - Create a Running total

Status
Not open for further replies.

post41

Programmer
May 14, 2001
1
US
I want to have a text box that displays a increasing running total - while the user is in that particular form.

I've tried some code, but it has not done what I want. It display the number, but I haven't figured out how display a the numbers increasing by 1's (to infinity).

Any suggestions?


Thx
 
to use a textbox to display a running total, put the following in your loop where you determine the total:

private sub RunningTotal()
Dim nTotal as Integer

nTotal = 1
While (Val(txtBox.Text) <= 1000)
txtBox.Text = txtBox.Text + nTotal
Wend
End Sub

This is just an example that will increment your total to 1000. Change things around to match your criteria.

Good Luck,
Michael G Bronner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top