Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function basRunSum(valAdd As Variant, _
Optional InitFlg As Boolean) As Variant
'To (properly) use this, you need to "Call" it ONCE, as shown below
'BEFORE each use of the query. Otherwise it will continue to accumulate
'the SUM from the last instantiation since it's LAST use in the current
'Program / Application session.
'? basRunSum(0, True)
'0
Static CummVal As Variant
If (InitFlg = True) Then
CummVal = 0
End If
CummVal = CummVal + valAdd
basRunSum = CummVal
End Function
ALTER TABLE TempTable ADD COLUMN NewID Counter;
Private Sub Command0_Click()
DoCmd.RunSQL ("SELECT tblAccounts.EmployeeName, tblAccounts.AmountDue, tblAccounts.AccountNumber INTO qryTempNewID FROM tblAccounts;")
DoCmd.RunSQL ("ALTER TABLE qryTempNewID ADD COLUMN NewID Counter;")
End Sub
RunningSum: dsum("[AmountDue]","qryTempNewID","[NewID]<="&NewID)