
May 12th, 2005, 05:21 PM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 6
Time spent in forums: 2 h 20 m 14 sec
Reputation Power: 0
|
|
Incrementing
Hello,
I am relatively new to VBA but I hope someone can help me.
I have a query that gets totals and names of employees and sorts the totals in descending order. What I need to do is to add an additional column which ranks them. The highest total and employee receives a ranking of 100. The next employee's ranking is the previous employee's ranking minus another number (generated by a different query.). The other number is a decimal value.
I have a function which will increment it down, however it keeps incrementing. So if you scroll down the list and then back up the list, the top person is no longer 100, their number has changed to something else. Also if another application's screen covers the results of the query and then is moved away the query's ranking also changes for each person.
Dows anyone know what I can do to have it stop at the end of the recordset? I have tried EOF but I just get an error each time the code is executed and a #Error in the ranked field for the entire query.
|