Dates and times in forms

Pusher

BEOGRAD Put
Local time
Today, 15:47
Joined
May 25, 2011
Messages
230
I have a date field in a form and 3 short time fields in the same form.
Does the short times contains the dates or is it just the Hour:Min and is that date the date i enter in that different date only field.
 
Date/Time is stored as a Double datatype. The date component is the number of days since 30/12/1899 while the time is the fraction of a day after the decimal.

Time format has a date component of zero (30/12/1899) which Access automatically supresses.

If you have a single DateTime field in the table each control (that is what they are called in Access, not fields) on the form can be bound to the same field but display a different format.
 
Thanks :)
That helped
 
BTW It is possible to store the date and time in one field but input them in two separate controls, one for Date and one for Time.

Use the BeforeUpdate Event of the Form to simply add the values of the two controls together and write to the field in the recordset of the form.

Code:
Private Sub Form_BeforeUpdate()
   Me!fldDateTime = Me.ctrlDate + Me.ctrlTime
End Sub
 

Users who are viewing this thread

Back
Top Bottom