How can I insert Autonumber in query

G

Guest

How can I insert autonumber field in my query.
This is my 2 Table
Table1 has 4 field: A, B, C and D
Table2 has 3 field: B, M and N
I need result in query 4 field like tihs
autonumber,A, B and M
sorting by B and then insert autonumber field
 
J

John Vinson

How can I insert autonumber field in my query.
This is my 2 Table
Table1 has 4 field: A, B, C and D
Table2 has 3 field: B, M and N
I need result in query 4 field like tihs
autonumber,A, B and M
sorting by B and then insert autonumber field

An Autonumber will not work here: it only exists in Tables, not in
Queries.

You can dynamically display a record counter on a Report by including
a textbox with a Control Source of 1 (just the number one) and setting
its RunningSum property to Over All.

In a Query you can include a calculated field:

Autonumber: DCount("*", "[YourQUeryName]", " <= " & )

Note that this can be rather slow since it must rerun the entire query
to count records - for every record returned.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top