Click to See Complete Forum and Search --> : Null dates ... can't update recordset via DAO
David Laplante
Jan 13th, 2000, 12:08 AM
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 :)
Aaron Young
Jan 13th, 2000, 12:53 AM
How are you Nulling the Date Value?
The following works for me:
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
aarony@redwingsoftware.com
ajyoung@pressenter.com
David Laplante
Jan 13th, 2000, 03:18 AM
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 :)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.