time format

awake2424

Registered User.
Local time
Today, 16:26
Joined
Oct 31, 2007
Messages
479
Code:
 Me.Time_Received = Time

The above code shows 4:04 PM in a field, but when I click on it has 1/1/1900 4:04:42 PM. The format is set to medium date, but it still is doing this. How can I fix it so it only displays the time and when I click on it the same? Thanks.
 
Code:
 Me.Time_Received = Time
The above code shows 4:04 PM in a field, but when I click on it has 1/1/1900 4:04:42 PM. The format is set to medium date, but it still is doing this. How can I fix it so it only displays the time and when I click on it the same? Thanks.

I am no expert, but I would try changing the format of the field to 'Short Time'
 
Did you look at all the other options?
 
DateTime is a Double type number made up of an integer section which is the date and the time as the decimal part. Hence times hold the zero date.

The Format Property only alters the display of the underlying value of a control or field. When it gets focus it will show the actual value.

You could avoid the problem by not allowing the control to get the focus.

Alternatively you would need to store the time as text which will introduce more complexity.
 
How do I turn off the focus so that only the time is there? Thanks.
 
In the Property sheet for the control.

Locked = True, Enabled = False
 

Users who are viewing this thread

Back
Top Bottom