a frenzy of numbers

BarnetBoy

Registered User.
Local time
Today, 18:41
Joined
Feb 12, 2004
Messages
10
Hi

Please treat me with sympathy. I'm a complete novice.

Another user on this forum very kindly gave me some code to assist me with creating a field in a query that generates a sequence of numbers based on time/date fields in the same query.

However it doesnt stop when it gets to the end of the records. As soon as I scroll from left to right and back again in datasheet view, the values start not from 1, but from the number of records+1.

Is there a way I can make it static so that I could refer to this value in another query or report?
Please help...

The code is:

Option Compare Database

Option Explicit
Dim mlngCounter As Long

Function ResetCounter()
mlngCounter = 0
End Function

Function GetNextCounter(pvar As Variant) As Long
mlngCounter = mlngCounter + 1
GetNextCounter = mlngCounter
End Function


Any help is appreciated. Thanks in advance.
 
Barnet,

I would say that you are running your code ...
Then NOT resetting the form's global counter to 0 (reset function)...
Then running your code again.

Wayne
 

Users who are viewing this thread

Back
Top Bottom