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 basNumRecs(varCount As Variant, Optional StrtNum As Variant = 1) As Long
Static lngCounter As Long 'Internal Counter for Return Value
Static RunningFlg As Boolean 'Flag for starting Input on strtNum only ONCE
Dim MyStrt As Long
If (Not RunningFlg) Then 'Have we been here?
RunningFlg = True 'If not yet, certainly NOW
If (IsNull(StrtNum)) Then 'Did we (NOT) get a starting Value?
MyStrt = 1 'Then assume ordinal 1
Else
MyStrt = StrtNum 'Otherwise use Input value
End If
lngCounter = MyStrt - 1 'Decrement start Value so User doesn't need to think
End If
lngCounter = lngCounter + 1 'Always increment
basNumRecs = lngCounter 'Return Results
End Function
RecNum: basNumRecs([ItemNum],[MyNum])