Chrisse, the code is in a calender and I'm getting 2002 numbers in Vacation, Sick, etc. for January 2003. I need it to read the year to distingush between 2001,2002,2003, etc.. Below is the code I'm using. Thanks
Option Compare Database
Option Explicit
Public glngUserID As Long
Public gstrMonth As String
Public gstrYear As String
Function Cal(m, Y, user As Long)
Dim a
Dim DayOne
Dim gOffset
Dim f As Form
Dim workdate
Set f = Forms!frmCalender
glngUserID = user
gstrMonth = m
gstrYear = Y
f!month.SetFocus
m = f!month
Y = f!year
For a = 1 To 37
f("Day" & a + gOffset).Visible = False
f("Text" & a + gOffset).Visible = False
f("date" & a + gOffset) = Null
f("day" & a + gOffset) = Null
Next
DayOne = DateValue(m & "/1/" & Y)
workdate = DayOne
gOffset = WeekDay(DayOne) - 1
For a = 1 To LenMonth(DayOne)
f("Day" & a + gOffset).Visible = True
f("Text" & a + gOffset).Visible = True
f("date" & a + gOffset) = workdate
workdate = workdate + 1
f("day" & a + gOffset) = a
Next
Call PutInData
GetVacationAndHolidays
End Function
Function LenMonth(d)
Dim start, finish
start = DateValue(month(d) & "/1/" & year(d))
finish = DateAdd("m", 1, start)
LenMonth = finish - start
End Function
Function SendToInputBox(mynum)
Dim f As Form
Dim g As String
Set f = Forms!frmCalender
g = Format(f("Date" & mynum), "dddd mmmm d, yyyy"
DoCmd.OpenForm "frmInputBox"
With Forms!frmInputBox
!InputDay = mynum
!InputDate = f("Date" & mynum)
!InputFor = g
!original_text = f("Text" & mynum)
!InputText = f("Text" & mynum)
!InputText.SetFocus
End With
SendKeys "{F2}^{HOME}", False
End Function
Public Sub PutInData()
Dim sql As String
Dim f As Form
Dim Db As Database
Dim rs As Recordset
Dim mynum
Dim i As Integer
Set f = Forms!frmCalender
For i = 1 To 37
f("text" & i) = Null
Next i
sql = "SELECT * FROM tblInput WHERE (((month([InputDate])) = " & f!month & " AND ((Year([InputDate])) = " & f!year & "

" _
& " And ((UserID) = " & glngUserID & "

)) ORDER BY InputDate;"
Set Db = CurrentDb()
Set rs = Db.OpenRecordset(sql, dbOpenSnapshot)
If rs.RecordCount > 0 Then
For i = 1 To 37
If IsDate(f("date" & i)) Then
rs.FindFirst "inputdate=#" & f("date" & i) & "#"
If Not rs.NoMatch Then
f("text" & i) = rs!InputText
End If
End If
Next i
End If
End Sub
Public Function GetVacationAndHolidays()
Dim strSQL
Dim frm As Form
Dim Db As Database
Dim rs As Recordset
Set frm = Forms!frmCalender
Set Db = CurrentDb
' Vacation Full Day Month
strSQL = "SELECT Count(InputID) AS TotDays FROM tblInput "
strSQL = strSQL & "WHERE ((Month([InputDate])=" & CInt(gstrMonth) & "

AND ((tblInput.UserID)=" & glngUserID & "

AND ((tblInput.InputText)='Vacation'));"
Set rs = Db.OpenRecordset(strSQL, dbOpenSnapshot)
frm!txtVacMo = rs!TotDays
rs.Close
strSQL = "'"
' Vacation Full Day Year
strSQL = "SELECT Count(InputID) AS TotDays FROM tblInput "
strSQL = strSQL & "WHERE ((Year([InputDate])=" & CInt(gstrYear) & "

AND ((tblInput.UserID)=" & glngUserID & "

AND ((tblInput.InputText)='Vacation'));"
Set rs = Db.OpenRecordset(strSQL, dbOpenSnapshot)
frm!txtVacYear = rs!TotDays
rs.Close
strSQL = "'"
' Vacation 1/2 Day Month
strSQL = "SELECT Count(InputID) AS TotDays FROM tblInput "
strSQL = strSQL & "WHERE ((Month([InputDate])=" & CInt(gstrMonth) & " & CInt(gstrYear) AND ((tblInput.UserID)=" & glngUserID & "

AND ((tblInput.InputText)=('1/2 Vacation Day')));"
Set rs = Db.OpenRecordset(strSQL, dbOpenSnapshot)
frm!txtVacHalf = rs!TotDays * 0.5 + frm!txtVacMo
rs.Close
strSQL = "'"
' Vacation YTD
strSQL = "SELECT Count(InputID) AS TotDays FROM tblInput "
strSQL = strSQL & "WHERE ((Year([InputDate])=" & CInt(gstrYear) & "

AND ((tblInput.UserID)=" & glngUserID & "

AND ((tblInput.InputText)=('1/2 Vacation Day')));"
Set rs = Db.OpenRecordset(strSQL, dbOpenSnapshot)
frm!txtVacYTD = rs!TotDays * 0.5 + frm!txtVacYear
rs.Close
strSQL = "'"