C
chanu
Public Function FindOption(presPay As Long, IncPay As Long) As Date
Dim Jul1New, Jul1NewNext, IncDatNew As Long
Dim FitmentTot, FitmentTotInc As Single
set FitmentTot = presPay + (presPay * 0.4026) + (presPay * 0.29)
set FitmentTotInc = IncPay + (IncPay * 0.4026) + (IncPay * 0.29)
Jul1New = DMin("Pay", tlkpPresentPay, "Pay >" & FitmentTot)
Jul1NewNext = DMin("Pay", tlkpPresentPay, "Pay >" & Jul1New)
IncDatNew = DMin("Pay", tlkpPresentPay, "Pay >" & FitmentTotInc)
If IncDatNew > Jul1NewNext Then
FindOption = "#10/12/2010#"
Else
FindOption = "#01/07/2009"
End If
End Function.
when i am compiling this the error that is thrown is Error 424 (Object
required) in the SET statement of the variable 'FitmentTot'. when i remove
the word SET, it is pointing to the tlkpPresentPay table and says variable
not defined.
can any one please help me how to come over this.
Thanks in advance
Dim Jul1New, Jul1NewNext, IncDatNew As Long
Dim FitmentTot, FitmentTotInc As Single
set FitmentTot = presPay + (presPay * 0.4026) + (presPay * 0.29)
set FitmentTotInc = IncPay + (IncPay * 0.4026) + (IncPay * 0.29)
Jul1New = DMin("Pay", tlkpPresentPay, "Pay >" & FitmentTot)
Jul1NewNext = DMin("Pay", tlkpPresentPay, "Pay >" & Jul1New)
IncDatNew = DMin("Pay", tlkpPresentPay, "Pay >" & FitmentTotInc)
If IncDatNew > Jul1NewNext Then
FindOption = "#10/12/2010#"
Else
FindOption = "#01/07/2009"
End If
End Function.
when i am compiling this the error that is thrown is Error 424 (Object
required) in the SET statement of the variable 'FitmentTot'. when i remove
the word SET, it is pointing to the tlkpPresentPay table and says variable
not defined.
can any one please help me how to come over this.
Thanks in advance