This tutorial will show you how to create a form that displays an amount that is regularly refreshed on a timer.
Sub CalcSalesValue
Dim SalesValue as Number
SalesValue = 0
Dim INHead as Object
INHead = OpenTable("INHead")
InHead.IndexName = "PeriodDocument"
INHead.SetRange(CurrentPeriod("IN"))
Do
If INHead.DocumentClass = "I" Then SalesValue = SalesValue + INHead.GrossAmountBs
INHead.Next
Loop Until INHead.EOF
lSalesValue.Caption = FormatNumber(SalesValue,",0.00")
End Sub
Note: This code adds values for Posted and Unposted Invoices, and excludes Credits. You can modify the code if you want to change this.
Ctrl+R). The form will display the Sales Invoice Value for this period, and will update the figure every ten minutes.