McSwifty,
After some sleep, it became clear that as beautiful as the db was designed, I would like to use rptyearview. So, qryYearView works fine as I do get appropriate results.
My issues are now:
1. a prompt for the parameter inputdate comes up and I can't see where it is coming from
2. when I open up the rptYearView, the below in red states VBA compile error, variable is not defined. I am just not sure what/where I have to define it.
Please help - I don't want to sleep on it again and come up with some other braniac idea that I don't need it at all LOL!
Thanks much - osmosisgg
Function getCalendarData() As Boolean
Dim rs As DAO.Recordset
Dim strDate As String
Dim strCode As String
Dim strSQL As String
Dim UserID As String
Dim LeaveDateFrom As String
Dim qdf As DAO.QueryDef 'sunday
Dim i As Integer
Set qdf = CurrentDb.QueryDefs("qryYearView")
qdf("employeehours.employee") = employeehours.employee
qdf("employeehours.year") = employeehours.Year
Set rs = qdf.OpenRecordset()
Set colCalendarDates = New Collection
With rs
If (Not .BOF) Or (Not .EOF) Then
.MoveLast
.MoveFirst
End If
If .RecordCount > 0 Then
For i = 1 To .RecordCount
strDate = .Fields("leavedatefrom")
strCode = .Fields("AttendanceCode")
colCalendarDates.Add strCode, strDate
.MoveNext
Next i
End If
.Close
End With
'// return date collection
Set rs = Nothing
End Function