Time stored as 12:00:00 AM

latex88

Registered User.
Local time
Today, 06:50
Joined
Jul 10, 2003
Messages
198
I have a date field that stores time based on a calculation or based on what the user chooses from a combo box. I use a global variable to store that time and updates a table. At the end of the sequence, I set the variable to 0.

In some occasions, the users do not have to choose the time, but an update query with the below function still runs. Even though there's no time, the table now stores 12:00:00 AM, which I understand come is equivalent to 0. Is there something simple I can do to ensure the table stores null instead of 12:00:00 AM?

To better understand how I'm passing the data, below are the variables and the function.

Dim dateArrival time as date
Public Function ArrivalTime ()
ArrivalTime () = dateArrival
End Function
 
At the end of the sequence, I set the variable to 0.
Can't you set it to Null?
 
At the end of the sequence, I set the variable to 0.
Can't you set it to Null?

No, I cannot. I believe number/or date data type must be set to 0.
 
No, I cannot. I believe number/or date data type must be set to 0.
You're right - a blunder of me.
If you declare dateArrival with a datatype as Variant, then you can set it both to Null and Time
 

Users who are viewing this thread

Back
Top Bottom