Re: Nulls in a Date field
Have you actually tried using the Null Value? ,e.g.
private Sub Command1_Click()
Dim oDB as Database
Dim oRS as Recordset
set oDB = Workspaces(0).OpenDatabase("DB1.mdb")
set oRS = oDB.OpenRecordset("SELECT * FROM Table1 WHERE ID=0", dbOpenDynaset)
oRS.AddNew
oRS("DateTimeField") = null
oRS.Update
set oRS = nothing
oDB.Close
set oDB = nothing
End Sub
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Re: Nulls in a Date field
No I hadn't tried that, but I did and it worked great. Why would rs.[datefield] = "" not work?
Regards,
Luanne Benedict
Re: Nulls in a Date field
Luanne,
Because "" is not null, it's an empty string. Which are two entirely different things to Access. Date fields in Access will not accept an empty string...
Re: Nulls in a Date field
Thank you both for your help. It's much appreciated!
Regards,
Luanne Benedict