I have a database where it scores vessels based on criteria and their values. In the event of a tie, my tiebreaker is what time a vessel stopped.
The tiebreaker is simple in concept. If there are 10 vessels in the table, I would have access count the number of vessels in my table, sort the date vessel stopped column from oldest to newest and then assing the value 10 to the top vessel, 9 to the one below it, 8 to the one below that and so forth.
I have a report that has calculated a vessels priority, however, I do not know how to cycle through each record displayed in the report and then assign the tie breaking value to the priority score. In excel i would accomplish this with writing a for statement that would cycle from the first record to the last record...offseting to my priorty Score column each time and then adding the tiebreaking score to it.
Dim x as integer
Dim Acell as Range
x = Application.WorksheetFunction.CountA(Sheets(1).Ran ge("A2:"A60000"))
For Each Acell in Range("A2:A60000")
Acell.Offset(0,WheremyPriorityScoreis).value = Acell.Offset(0,WheremyPriorityScoreis).value + x
x = x-1
Next Acell
How do i accomplish something similar to a report in access? At first I thought the correct way would be something like this:
x= Dcount("Stopped","Table")
For each Record in Field
me.priorityscore.value = me.priorityscore.value + x
x = x - 1
Next Record.
But I found out miserably that this is totally wrong. Any help with this would be greatly appreciated.