[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

A running Sub-Total

Posted on 2005-05-10
6
Medium Priority
?
164 Views
Last Modified: 2010-05-02
Hello Experts,

Is it possible to add a value to a global variable and have additional values append instead of replace? So that I can have a running total?

Thanks
0
Comment
Question by:dominica526
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:cachedVB
ID: 13974589
Hi dominica526,
You can have the global variable be an array and do just t hat, just place the number in the next element of the array each time
cachedVB
0
 
LVL 22

Accepted Solution

by:
JesterToo earned 2000 total points
ID: 13974612
I think you mean something like this...

Global  intGrandTotal  As Integer     <-- change to whatever numeric datatype you need
.
.
.
.
intGrandTotal = intGrandTotal + intAnotherIncrementOrDecrement

HTH,
Lynn
0
 
LVL 22

Expert Comment

by:JesterToo
ID: 13974633
Perhaps I should have given a better example...

Public intGrandTotal As Integer

intGrandTotal = 15                             ' running total is 15
intGrandTotal = intGrandTotal + 10      ' running total is 25
intGrandTotal = intGrandTotal - 4        ' running total is 21
intGrandTotal = intGrandTotal + 7       ' running total is 28
intGrandTotal = intGrandTotal * 3       ' running total is 84      
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dominica526
ID: 13974636
I think you are correct sir! Hummmm + intAnotherIncrementOrDecrement I would have never come-up with that, thanks!
0
 
LVL 22

Expert Comment

by:JesterToo
ID: 13974638
You're very welcome, and thank you for the grade!

-- Lynn
0
 

Author Comment

by:dominica526
ID: 13974675
Lynn,

Help!!! intAnotherIncrementOrDecrement only works on one computer!! What does it need installed to work??
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question