Hello,
I have succesfully used the code below to create basic group headers on a Form from a single Table (Access 2003). It works well.
But, I have a slight problem in that the field (names) is coming from a second table in my database and I cannot work out how to collect 'state' from MyTable (primary key = 'ID') and 'names' from MyTable2 (foreign key = 'link') and still apply the 'rank'.
Any help would be much appreciated - thank you.
Garry
I have succesfully used the code below to create basic group headers on a Form from a single Table (Access 2003). It works well.
Code:
SELECT
m1.state,
m1.names,
(
SELECT Count(names)
FROM MyTable AS m2
WHERE
m2.state=m1.state
AND m2.names<=m1.names
) AS rank
FROM MyTable AS m1
ORDER BY m1.state, m1.names;
But, I have a slight problem in that the field (names) is coming from a second table in my database and I cannot work out how to collect 'state' from MyTable (primary key = 'ID') and 'names' from MyTable2 (foreign key = 'link') and still apply the 'rank'.
Any help would be much appreciated - thank you.
Garry