Run-time error '2147352567 (80020009)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eneyardi
    New Member
    • Jul 2010
    • 180

    #1

    Run-time error '2147352567 (80020009)

    Update or CancelUpdate without AddNew or Edit

    How to subtract date and the result will be number of days?
    Coz i have a table name tblDate, fieldname subject, date received, date release and no. of days elapsed,. I have a form name DTS Entry, textbox name subject, date received, date released and no. of days released. the data type of subject is text, the date received and date released are date/time, and the no. of days elapsed is text. the textbox no. of days elapsed is equal to current date minus date released. I want to automatically the form will be updated or the textbox no. of days elapsed will be updated to the subtraction of current date and date released.

    This is the code i made but i encounter an error:

    Private Sub Form_BeforeUpda te(Cancel As Integer)
    If Me.Combo165 = "Done" Then
    Me.[no. of days elapsed] = "0"
    Else
    If Me.Combo165 = "Pending" Then
    Me.[no. of days elapsed] = [current date] - [date released]
    End If
    End If
    End Sub
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    Replace
    Code:
    Me.[no. of days elapsed] = [current date] - [date released]
    with
    Code:
    Me.[no. of days elapsed] = datediff("d",[current date],[date released])

    Comment

    Working...