Okay, I'm new to this and about to go crazy. Whats wrong with the code below?
Function addDays(employID As Long, daType As String, daEXPDATE As Date, daREMARKS As String)
Dim daNOW As Date
Dim daDAYS As Double
Dim daSEARCH As String
Dim rst As Recordset
daNOW = Now()
daYEARS = Int((Now() - (DLookup("[hiredate]", "employees", "ID = " & employID))) / 365.25) ' Number Emp has been in company
daSEARCH = "begyear <= " & daYEARS & ", uptoyear > " & daYEARS & ", type = '" & daType & "' "
CurrentDb.Recordsets("TableOfDaysEarned").FindFirst (daSEARCH) '<-- I keep getting an error "Item Not Found in Collection"
There is one item in table "TableOfDaysEarned" that meets this criteria. I have verified it several times. I have even tried simplifying the query to:
daSEARCH = "type ='v'" of which, there are 3 entries. Still, I get the same error "Item not found in collection".
Function addDays(employID As Long, daType As String, daEXPDATE As Date, daREMARKS As String)
Dim daNOW As Date
Dim daDAYS As Double
Dim daSEARCH As String
Dim rst As Recordset
daNOW = Now()
daYEARS = Int((Now() - (DLookup("[hiredate]", "employees", "ID = " & employID))) / 365.25) ' Number Emp has been in company
daSEARCH = "begyear <= " & daYEARS & ", uptoyear > " & daYEARS & ", type = '" & daType & "' "
CurrentDb.Recordsets("TableOfDaysEarned").FindFirst (daSEARCH) '<-- I keep getting an error "Item Not Found in Collection"
There is one item in table "TableOfDaysEarned" that meets this criteria. I have verified it several times. I have even tried simplifying the query to:
daSEARCH = "type ='v'" of which, there are 3 entries. Still, I get the same error "Item not found in collection".