Hi Beeyen
You can simply add a pure time value (no date) to a pure date value (no
time) to give you the time of day on the given date.
It helps to know how date/time values are represented internally. They are
stored as a 64-bit floating-point number (same as a Double), where the
integer part represents the date and the fractional part represents the time
(as a fraction of 24 hours).
The integer date is the number of days after 30-Dec-1899 (or before, if it
is negative).
For example, 3.25 is 6am on 2-Jan-1900, because 2-Jan-1900 is 3 days after
30-Dec-1899, and 0.25 of 24 hours is 6 hours - hence 6am.
(You can verify this by typing ?CDate(3.25) into the immediate window.)
So given any date value (which could be a date returned from Allen's
calendar) you can add a time value to it. Assuming you have a Date variable
named "dt" which currently holds the value 30-Mar-2009, you could add the
time in a number of ways. For example:
dt + TimeValue("9:25 pm") - gives 30-Mar-2009 9:25:00 pm
dt + TimeSerial(21, 25, 0) - same result
dt + Time - gives the current time on 30-Mar-2009
dt + TimeValue(Now) - same result
Note that you can ensure you have a "pure" date or time value by using the
DateValue or TimeValue functions. DateValue will remove any time component
and TimeValue will remove any date component.
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
Beeyen said:
Good Day,
I am using the Pop-up calendar, which was so gracously provided by Mr
Browne. But I would like to add the current day and time with the date ,
if
possible when the date is selected. Assuming it is OK, Would anyone know
how
this can be accomplished in the Calendar Design form.
Thanks