How to number items in query

  • Thread starter Thread starter Guillaume Hanique
  • Start date Start date
G

Guillaume Hanique

Hello!

I have a query that gets a subset of a table and sorts it. What I'd
like to do, is number the items in the query. So suppose the query
returns:

Mr Smith
Mr Johnson
Mr Whatever

What I would like is

1 Mr Smith
2 Mr Johnson
3 Mr Whatever

I tried writing a function in MS Access that returns a unique value
each time it is called, but it is only called once, so all the
"unique" numbers are the same.

Anybody an idea on how to achive this?

Thanks,
Guillaume Hanique.
 
-----Original Message-----
Hello!

I have a query that gets a subset of a table and sorts it. What I'd
like to do, is number the items in the query. So suppose the query
returns:

Mr Smith
Mr Johnson
Mr Whatever

What I would like is

1 Mr Smith
2 Mr Johnson
3 Mr Whatever

I tried writing a function in MS Access that returns a unique value
each time it is called, but it is only called once, so all the
"unique" numbers are the same.

Anybody an idea on how to achive this?

Thanks,
Guillaume Hanique.
.
pass a value to your function to force it to run for each
record. it doesn't matter what field in the query you pass
to the function, because you don't need to actually use
the value in the function itself.
 
Thanks, that's it.

It's so simple, but I just didn't seet it.

Thanks again,
Guillaume Hanique.
 
Back
Top