Just to show you, this is part of one of the queries:
strSQL = "SELECT qryListHoursTime.LaborDetailsID, IIf([ContractTypeID]='PT08',IIf([Hours]>8,8,IIf(([RunningSum2]-[Hours])>=8,0,[Hours])),IIf((SELECT Sum([Hours]) FROM [qryListHoursTime] AS [qryListHoursTime_1] WHERE...