IloveCaffeine
Aug 2nd, 2005, 03:52 PM
Can anyone please help me with this trying to make a session counter that but right now its incrementing at the start then increments again when i eather refresh or begin a new session but only increments again one time.
Thanks for your time and help!
This is my code so far.
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Const INCREMENT_COUNT = 0
Const DECREMENT_COUNT = 1
Const RESET_COUNT = 2
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Call MakeCount(INCREMENT_COUNT)
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
Call MakeCount(DECREMENT_COUNT)
End Sub
Sub MakeCount(ByVal iCountType)
On Error Resume Next
Select Case iCountType
Case RESET_COUNT
Application.Lock()
Application("Count") = 0
Application.UnLock()
Case INCREMENT_COUNT
Application.Lock()
Application("Count") = Application("Count") + 2
Application.UnLock()
Case DECREMENT_COUNT
'If Application("Count") > 0 Then
Application.Lock()
Application("Count") = Application("Count") - 1
Application.UnLock()
'End If
End Select
End Sub
Thanks for your time and help!
This is my code so far.
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Const INCREMENT_COUNT = 0
Const DECREMENT_COUNT = 1
Const RESET_COUNT = 2
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Call MakeCount(INCREMENT_COUNT)
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
Call MakeCount(DECREMENT_COUNT)
End Sub
Sub MakeCount(ByVal iCountType)
On Error Resume Next
Select Case iCountType
Case RESET_COUNT
Application.Lock()
Application("Count") = 0
Application.UnLock()
Case INCREMENT_COUNT
Application.Lock()
Application("Count") = Application("Count") + 2
Application.UnLock()
Case DECREMENT_COUNT
'If Application("Count") > 0 Then
Application.Lock()
Application("Count") = Application("Count") - 1
Application.UnLock()
'End If
End Select
End Sub