E
ElPresidente
I need to export some data from Access however one of the columns
needs to be a sequential ID. The underlying table does not have any
numeric fields which I can use to create this numbered colum using the
sub-query trick.
Instead, I tried this. In a module I wrote the following code:
Public Function currentLine(test As String) As Integer
counterVB = counterVB + 1
currentLine = counterVB
End Function
In my query, I wrote one of the columns as
LINE_NUMBER: currentLine([InvoiceNumber])
If you're wondering why I'm passing a variable that's not being used
it's because this forces the function to be run for each row.
Otherwise, the entire column contained the same number.
The strange thing is that every time I move the window, resize the
window, or scroll, the entire LINE_NUMBER column recalculates from top
to bottom. So I still have a sequential recordset however the numbers
quicky balloon into the thousands with enough movements.
How can I stop this recalcuation?
needs to be a sequential ID. The underlying table does not have any
numeric fields which I can use to create this numbered colum using the
sub-query trick.
Instead, I tried this. In a module I wrote the following code:
Public Function currentLine(test As String) As Integer
counterVB = counterVB + 1
currentLine = counterVB
End Function
In my query, I wrote one of the columns as
LINE_NUMBER: currentLine([InvoiceNumber])
If you're wondering why I'm passing a variable that's not being used
it's because this forces the function to be run for each row.
Otherwise, the entire column contained the same number.
The strange thing is that every time I move the window, resize the
window, or scroll, the entire LINE_NUMBER column recalculates from top
to bottom. So I still have a sequential recordset however the numbers
quicky balloon into the thousands with enough movements.
How can I stop this recalcuation?