> These lines at the very beginning..
>
>> If IsNull(rs!MaxOfDueDate) = True Then
>> holdingdate = DateSerial(Year(Date), Month(Date), 1)
>> Else
>> holdingdate = (rs!MaxOfDueDate + rs!DaysBetweenJobs)
>> End If
>
> "Alex Dybenko" <alexdyb[ at ]PLEASE.cemi.NO.rssi.SPAM.ru> wrote in message
> news:uE0si3MpGHA.1440[ at ]TK2MSFTNGP03.phx.gbl...
>> Hi,
>> at what line you have this error? null in rs!DaysBetweenJobs can be a
>> cause of this error
>>
>> --
>> Best regards,
>> ___________
>> Alex Dybenko (MVP)
>>
http://alexdyb.blogspot.com>>
http://www.PointLtd.com>>
>> "BW" <basic8[ at ]hotmail.com> wrote in message
>> news:ekPoTWKpGHA.2464[ at ]TK2MSFTNGP03.phx.gbl...
>>>I have the following code loaded on a simple for with a command button to
>>>execute it. When I run this code it tells me every time that the
>>>[duedate] field is always null. I open up the query and can clearly see
>>>that there are dates in this field for most records but it never
>>>recognized them. I'm sure I''ve got some thing wrong in here that is
>>>causing it. Thanks in Advance...
>>>
>>>
>>> Dim rs As New ADODB.Recordset
>>> Dim rs1 As New ADODB.Recordset
>>> Dim holdingdate As Date
>>>
>>> rs.Open "qrybase1", CurrentProject.Connection, adOpenDynamic,
>>> adLockReadOnly
>>>
>>> Do Until rs.EOF
>>>
>>> If IsNull(rs!MaxOfDueDate) = True Then
>>> holdingdate = DateSerial(Year(Date), Month(Date), 1)
>>> Else
>>> holdingdate = (rs!MaxOfDueDate + rs!DaysBetweenJobs)
>>> End If
>>>
>>> Do While Month(holdingdate) = Month(Date)
>>> rs1.Open "tblwofile", CurrentProject.Connection, adOpenDynamic,
>>> adLockOptimistic
>>> rs1.AddNew
>>> rs1!siteid = rs!siteid
>>> rs1!WorkRequired = "Required"
>>> rs1!WorkCategory = "Base One"
>>> rs1!OpenDate = holdingdate
>>> rs1!duedate = holdingdate
>>> rs1!ClientID = rs!ClientID
>>> rs1.Update
>>> rs1.Close
>>> holdingdate = holdingdate + rs!DaysBetweenJobs
>>> Loop
>>>
>>> rs.MoveNext
>>> Loop
>>> rs.Close
>>> Set rs = Nothing
>>> Set rs1 = Nothing
>>>
>>
>
>