Create in a VBA module such code:
[color blue]
global IncrementVariable as integer
function IncrementValues() as integer
IncrementVariable = IncrementVariable + 1
IncrementValues = IncrementVariable
end function
[/color]
in the query you will do
[color blue]
select IncrementValues(), xxx, yyy, zzz from yourTable
[/color]
Each time you want to use a new counter, to reser the increment, or when you use it first time I recommend to run the code:
[color blue]
IncrementVariable = 0
[/color]
or make a function
[color blue]function ResetCounter()
IncrementVariable = 0
end function[/color]
and call
[color blue]ResetCounter()[/color]
the last reseting method is more reliable.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.