I assume that the scores are in a column in a table on which the form is
based. You can display the ranking in an unbound text box on the form (don't
have a ranking column in the table as that introduces redundancy) with a
ControlSource of:
= DCount("*","YourTable", "Score >" & [Score])+1
This counts the rows with a score higher than the current record's score and
adds 1, and will also handle ties, so if two scores tie for second place
they'll both be ranked second and the next lowest score will be ranked fourth.
If you want to rank within a subset of rows in the table, e.g. if you have
multiple events in the table, each identified by a numeric value in an
EventID column, and toy want the ranking for each event, then you'd include
this in the criteria for the DCount function:
= DCount("*","YourTable", "EventID = " & [EventID] & " And Score >" &
[Score])+1
You can of course do the same in a report or in a computed column in a
query. If you don't need the query to be updatable you can also use a
subquery to compute the ranking:
SELECT Score,
(SELECT COUNT(*)
FROM YourTable AS T2
WHERE T2.Score >T1.Score)+1
AS Ranking
FROM YourTable AS T1
ORDER BY Score DESC;
Note how the two instances of the table are differentiated by giving them
aliases T1 and T2.
Ken Sheridan
Stafford, England