I would like to blank a Date / Time field

rbinder

rbinder
Local time
Today, 14:15
Joined
Aug 13, 2005
Messages
25
Greetings,

I am running some code to work on a table and I want to blank a date field. It is a stock control system where when a vessel is emptied I would like the updated field to become blank as it is empty and therefore has no history (this is stored in another table.)

The code I have tried to us is; (where updated is a date/time field)

Else
rst![Updated] = " "
rst![Volume] = "0"
End If
rst.Update
rst.Close

The message I am getting is 'Data type conversion error'.

How do I get this field to be blank by code?

Thanks in advance
rbinder
 
I can't tell which field is the date field but in either case a date field is a very special double precision numeric field. You are trying to put a string value into it and that will not work, as you discovered. You might try setting it to Null, but I'm not sure it will take it and I haven't tested it. Without knowing more about your tables it feels like your data is not completely normalized. If it were, I would think you would add another record rather than going back and modifying an existing one.
 

Users who are viewing this thread

Back
Top Bottom