
Originally Posted by
CJ_London
Shame you don't actually try some of these suggestions and understand how they work..
Okay, after some time staring at this way too late at night, I think what you're saying is there has to "be a change" for the function to run.
So, for grins I tried a slightly modified version of your code (ditching my code) and added what I think you're saying is needed to the append query (for a newer table).
Code:
Function fRowNumber(Optional r As Variant = -1) As Variant
Static X As Long
If r = -1 Then
X = 100191
Else
X = X + 1
End If
fRowNumber = X
End Function
I ran it to see what happens, and I get nothing back for results. I'll play with it, but still not sure of what exactly I should be doing.
Here's the new query for counties:
Attachment 50006
The source table looks like this: