How to invoke the call function in code? Pls provide the code?
Code:
Function getCalendarData(employeeID As Long) As Boolean
Dim rs As DAO.Recordset
Dim strDate As String
Dim strCode As String
Dim strSQL As String
Dim i As Integer
'//Set rs = CurrentDb.OpenRecordset("t_employeeAttendance", dbOpenDynaset)
strSQL = "SELECT * From t_employeeAttendance WHERE employeeID = " & employeeID
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
Set colCalendarDates = New Collection
With rs
'//If (Not .BOF) Or (Not .EOF) Then
'// .MoveLast
'// .MoveFirst
'//End If
If .RecordCount > 0 Then
.MoveLast
.MoveFirst
For i = 1 To .RecordCount
strDate = .Fields("attendanceDate")
strCode = .Fields("statusCode")
colCalendarDates.Add strCode, strDate
.MoveNext
Next i
End If
.Close
End With
'// return date collection
Set rs = Nothing
End Function