Access does not support that function. If your ID
field is a numeric primary key, you can include a field expression which is the count of the number of rows with ID
<= to the current ID
value.
SELECT
DCount('*', 'YourTable', 'ID <= ' & y.ID) AS NID,
y.ID,
y.value
FROM YourTable AS y;
You could use a correlated subquery instead of DCount
if you prefer.
And ID
does not actually have to be a primary key. If it has a unique constraint it is still suitable for this purpose.
And the targeted field does not absolutely have to be a number, but text data type can be more challenging.