Autonumbering Query

R

Reva

I have 2 tables. Table 1 contains an indexed autonumber field named QID.
Table 2 contains the same name field - it is a number field. The two fields
are linked in the relationships as 1 to many and the form is working as
expected. What I am trying to do is insert a secondary autonumber field in
Table 2 which will restart at #1 everytime a new record is created in Table
1. Eg. Table 1 will have record 1, 2, 3....etc. I want Table 2 to have
record 1.1, 1.2, 1.3....etc. (the 1 coming from the QID field in Table 1).
The .1 etc. from the autonumber field in Table 2. Therefore when Record 2 is
created in Table 1, Table 2 will be Record 2.1, 2.2, 2.3...etc.

Is this possible?
 
A

Allen Browne

This article provides some options:
http://allenbrowne.com/ranking.html#query

There's not a really simple version. Essentially, you use a subquery to
count the number of preceding values for the particular foreign key value,
or use a DCount() expression if you really need the query to be updatable
and don't mind it slowing to a crawl.
 

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