Below are two examples, one using CDate, the other using TimeSerial. Using
TimeSerial is probably the safer, less ambiguous option. See the help topic
'TimeSerial Function' for more information.
? CDate("13:35")
13:35:00
? TimeSerial(13,35,0)
13:35:00
If you are storing these values in a Date/Time field, don't forget that a
Date/Time field always includes a complete date and time. As you are not
specifying the date part, it will default to 30 December, 1899.
--
Brendan Reynolds
Access MVP
"pete2586" <(E-Mail Removed)> wrote in message
news:85797AB2-A4A9-4679-A87C-(E-Mail Removed)...
> I'm trying to convert a string to a time using the CDate function.
> However, I
> can't get it to work. The date is in 24-hour format. Part of the code is
> shown below:
>
> timev = Hr & ":" & Min & ":00"
> rcs1(4) = timev
>
> Do I need to specify somehow that the time is in 24-hour format?
>
> Thanks
|