D
Dale
I am trying to create a tool for yearly employee performance reviews: each
employee is ranked on 5-10 different "competencies" and their behavior
related to those competencies throughout the year. I have a table tracking
those events. At year end I would like to create a report bound to a query
that groups the employee by competency, avg rank for the competency and lists
each observed behaviour for the entire year in its own field.
The tblDailyObserved table lists Empname, Competency, Edate, Behavior, Rank
EmployeeN Competency Rank Behavior
John Smith Customer Focus 5 Text 1
Text 2
Text 3
I have this as a function so far and its not working: (HA! thought this
would be simple!)
Public Function AggCom(sEmpName, sCompetency,sEvent, sDate) As String
On Error Resume Next
Dim db As DAO.Database, rst As DAO.Recordset, sSQL As String
Set db = CurrentDb
sSQL = "SELECT EmployeeN, Competency, Edate, Event FROM tblDailyObserved
ORDER BY EmployeeN, Competency ASC"
Set rst = db.OpenRecordset(sSQL, dbOpenSnapshot)
rst.MoveFirst
Do While sEmpName = rst!EmployeeN And sCompetency = rst!Competency
AggCom = sDate & ": " & sEvent & vbCrLf & vbCrLf & rst!EDate & ": " &
rst!Event
rst.MoveNext
Loop
Set rst = Nothing
Set db = Nothing
End Function
Thanks in a advance for your help.
employee is ranked on 5-10 different "competencies" and their behavior
related to those competencies throughout the year. I have a table tracking
those events. At year end I would like to create a report bound to a query
that groups the employee by competency, avg rank for the competency and lists
each observed behaviour for the entire year in its own field.
The tblDailyObserved table lists Empname, Competency, Edate, Behavior, Rank
EmployeeN Competency Rank Behavior
John Smith Customer Focus 5 Text 1
Text 2
Text 3
I have this as a function so far and its not working: (HA! thought this
would be simple!)
Public Function AggCom(sEmpName, sCompetency,sEvent, sDate) As String
On Error Resume Next
Dim db As DAO.Database, rst As DAO.Recordset, sSQL As String
Set db = CurrentDb
sSQL = "SELECT EmployeeN, Competency, Edate, Event FROM tblDailyObserved
ORDER BY EmployeeN, Competency ASC"
Set rst = db.OpenRecordset(sSQL, dbOpenSnapshot)
rst.MoveFirst
Do While sEmpName = rst!EmployeeN And sCompetency = rst!Competency
AggCom = sDate & ": " & sEvent & vbCrLf & vbCrLf & rst!EDate & ": " &
rst!Event
rst.MoveNext
Loop
Set rst = Nothing
Set db = Nothing
End Function
Thanks in a advance for your help.