This is a very complex query for me, here is the sql code for it. It is used to calculate the Fica,Medicare,Fit and totals. It also has a module.
Here also is code form my Module Named ModDate.
Function Fica()
Fica = DLookup("FicaMul", "TFica", "FicaMulDate = #" & DMax("FicaMulDate", "TFica", "FicaMulDate <=DteEnd()") & "#")
Fica_Exit:
Exit Function
Fica_Error:
MsgBox "Unexpected error - " & err.Number & vbCrLf & vbCrLf & Error$, vbExclamation, "Function Fica()"
Resume Fica_Exit
End Function
Function FIT()
FIT = DLookup("FITMul", "TFIT", "FITMulDate = #" & DMax("FITMulDate", "TFIT", "FITMulDate <=DteEnd()") & "#")
FIT_Exit:
Exit Function
FIT_Error:
MsgBox "Unexpected error - " & err.Number & vbCrLf & vbCrLf & Error$, vbExclamation, "Function FIT()"
Resume FIT_Exit
End Function
Function Med()
Med = DLookup("MedMul", "TMed", "MedMulDate = #" & DMax("MedMulDate", "TMed", "MedMulDate <=DteEnd()") & "#")
Med_Exit:
Exit Function
Med_Error:
MsgBox "Unexpected error - " & err.Number & vbCrLf & vbCrLf & Error$, vbExclamation, "Function Med()"
Resume Med_Exit
End Function
Function OT() '12/9/03 This should be deleted as it does not work correctly.
OT = DLookup("OTRate", "TOTRate", "OTRateDate = #" & DMax("OTRateDate", "TOTRate", "OTRateDate <=DteEnd()") & "#")
OT_Exit:
Exit Function
OT_Error:
MsgBox "Unexpected error - " & err.Number & vbCrLf & vbCrLf & Error$, vbExclamation, "Function OT()"
Resume OT_Exit
End Function