Recordset not updateable with Immediate IF / date function
Posted on 2005-04-12
Does anyone have a clue as to why this line of code (entered by another programmer, gone) would error out with 'Recordset not updateable'?
The first line (SpecialProjects=......) will produce the error in the Immediate window. The back end tables are off a SQL Server. I have a suspicion it has something to do with dates being handled differently between Access and SQL Server.
I have the whole program but this is the routine being called.
Even a point in the right direction would be appreciated! Thanks
Public Sub LoadTimes()
SpecialProjects = IIf(IsDate(dtmSpecialProjects) = True, dtmSpecialProjects, #12:00:00 AM#)
Administrative = IIf(IsDate(dtmAdministrative) = True, dtmAdministrative, #12:00:00 AM#)
ABT = IIf(IsDate(dtmABT) = True, dtmABT, #12:00:00 AM#)
TotalNonMeasured = IIf(IsDate(dtmSpecialProjects) = True, dtmSpecialProjects, 0) + IIf(IsDate(dtmAdministrative) = True, dtmAdministrative, 0) + IIf(IsDate(dtmABT) = True, dtmABT, 0)
ComputerDownTime = IIf(IsDate(dtmComputerDownTime) = True, dtmComputerDownTime, #12:00:00 AM#)
Overtime = IIf(IsDate(dtmOvertime) = True, dtmOvertime, #12:00:00 AM#)
The resulting error:
Run-time error '-2147352567 (80020009)':
This Recordset is not updateable