I have used some VBA code to increment a "index" row in an append query. See below. The code works correctly when used from my local desktop, but once accessed through citrix, it does not perform the same. What happens is: it calls the function once, and for each record, it places the same "index". My goal is to have unique "indicies". I cannot figure out why this occurs. Anyone know?
Global IncrementVariable As Long
Global FT_SOURCE_ID_OLD As Long
Global FT_SOURCE_ID_NEW As Long
Function IncrementValues(FT_SOURCE_ID_NEW) As Long
If (FT_SOURCE_ID_NEW = FT_SOURCE_ID_OLD) Then
Else
IncrementVariable = 0
End If
IncrementVariable = IncrementVariable + 1
FT_SOURCE_ID_OLD = FT_SOURCE_ID_NEW
IncrementValues = IncrementVariable
End Function
Global IncrementVariable As Long
Global FT_SOURCE_ID_OLD As Long
Global FT_SOURCE_ID_NEW As Long
Function IncrementValues(FT_SOURCE_ID_NEW) As Long
If (FT_SOURCE_ID_NEW = FT_SOURCE_ID_OLD) Then
Else
IncrementVariable = 0
End If
IncrementVariable = IncrementVariable + 1
FT_SOURCE_ID_OLD = FT_SOURCE_ID_NEW
IncrementValues = IncrementVariable
End Function