F
Fasiano
hello there. i am working on my final year project and i stuck in the.
if anybody could help me please do it.
i have created a query named "general" which gets its values, "Studentid"
"class" "date" from tables which are updated from forms.
what i need is to create a counter:
This is what i have:
StudentID Class Date
S021N0032 EENG233 1/1/2007
S021N0032 EENG233 3/3/2007
S021N0032 EENG233 5/6/2007
S033N0033 EENG111 1/4/2007
S033N0033 EENG111 15/6/2007
This is what i want:
StudentID Class Date Counter
S021N0032 EENG233 1/1/2007 1
S021N0032 EENG233 3/3/2007 2
S021N0032 EENG233 5/6/2007 3
S033N0033 EENG111 1/4/2007 1
S033N0033 EENG111 15/6/2007 2
When the StudentID or Class changes no matter the date, the counter should
add one to its previous value.
i have created a module which always returns the value 1 to my counter
thats it:
Option Compare Database
Global StudentID As String, MyCount As Integer, GlobClass As String
Function ReturnRecordCount(StudentID As String, Class As String)
If StudentID <> GlobStudentID Or Class <> GlobClass Then
GlobStudentID = StudentID
GlobClass = Class
MyCount = 1
Else
MyCount = MyCount + 1
End If
ReturnRecordCount = MyCount
End Function
please send me a reply to correct my module or create a new one.
thank you.
if anybody could help me please do it.
i have created a query named "general" which gets its values, "Studentid"
"class" "date" from tables which are updated from forms.
what i need is to create a counter:
This is what i have:
StudentID Class Date
S021N0032 EENG233 1/1/2007
S021N0032 EENG233 3/3/2007
S021N0032 EENG233 5/6/2007
S033N0033 EENG111 1/4/2007
S033N0033 EENG111 15/6/2007
This is what i want:
StudentID Class Date Counter
S021N0032 EENG233 1/1/2007 1
S021N0032 EENG233 3/3/2007 2
S021N0032 EENG233 5/6/2007 3
S033N0033 EENG111 1/4/2007 1
S033N0033 EENG111 15/6/2007 2
When the StudentID or Class changes no matter the date, the counter should
add one to its previous value.
i have created a module which always returns the value 1 to my counter
thats it:
Option Compare Database
Global StudentID As String, MyCount As Integer, GlobClass As String
Function ReturnRecordCount(StudentID As String, Class As String)
If StudentID <> GlobStudentID Or Class <> GlobClass Then
GlobStudentID = StudentID
GlobClass = Class
MyCount = 1
Else
MyCount = MyCount + 1
End If
ReturnRecordCount = MyCount
End Function
please send me a reply to correct my module or create a new one.
thank you.