Ranking And Resetting

Paul Barry

New member
Local time
Tomorrow, 02:19
Joined
Jul 28, 2013
Messages
1
Hi guys,
Urgent help needed to develop the rank and reset functions below. The rank works but not the reset! The rank values continue to increase on calling of the module! :banghead: Edit the codes and repost if necessary.

Option Compare Database
Dim Temp As Integer
Public Function Reset(ByVal Count As Integer) As Integer
If Temp > Count Then
Temp = 0
End If
End Function
Public Function RankAll(ByVal Marks As Integer) As Integer
If Temp = 0 Then
RankAll = 1
Temp = Temp + 1
Else
RankAll = Temp + 1
Temp = Temp + 1
End If
End Function
 
Bit of a guess but have you tried putting an initial value for Temp before line 4 (where it is compared to Count)?
 
I think temp should be declared as Public

Public Temp As Integer


Brian
 

Users who are viewing this thread

Back
Top Bottom