KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Accumulating a field value in the form header
PRODUCT: 4D | VERSION: 6.5 | PLATFORM: Mac & Win
Published On: August 10, 2001
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

When displaying an output form, you may want to display in the header a variable that accumulates the value for one specific field. You can do so by placing the following code in the object method for the variable which accumulates the value:

Case of
 : (Form event=On Header )
   MyVar2:=Sum([Table 1]Field3)
   `MyVar2 is the variable displayed in the header
End case

Please note that the Sum command uses indices when available. Therefore, indexing the field that is accumulated will greatly enhance the speed.