Results 1 to 3 of 3

Thread: Null dates ... can't update recordset via DAO

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241

    Post

    I checked for other posts and some of them said that you CAN update NULL into a date/time field of an access database via DAO... How come I get a #13 'Type mismatch'?

    Please help this is anoying me alot

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    How are you Nulling the Date Value?

    The following works for me:
    Code:
    Private Sub Command1_Click()
        Dim oDB As Database
        Dim oRS As Recordset
        
        Set oDB = OpenDatabase("C:\Files\DB1.mdb")
        Set oRS = oDB.OpenRecordset("MyTable", dbOpenTable)
        While Not oRS.EOF
            oRS.Edit
            oRS("DateField") = Null
            oRS.Update
            oRS.MoveNext
        Wend
        oRS.Close
        oDB.Close
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241

    Post

    Thanks Aaron...
    I'm stupid... you told me once that in a IIF, vb checks both possibilities... that was in a IIF.... gess I forgot what the master said to the student

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width