Concatenate Time in String

  • Thread starter Thread starter DD
  • Start date Start date
D

DD

I need to have a text box that picks up a time from a
field. I need the text box to say: Start Time: 7:00 a.m.
for example. Note that 7 is not preceeded by a zero and
there is no seconds. When I program my text box, I cannot
get the short time in this format. It appears as 07:00:00.
Please help.
 
DD said:
I need to have a text box that picks up a time from a
field. I need the text box to say: Start Time: 7:00 a.m.
for example. Note that 7 is not preceeded by a zero and
there is no seconds. When I program my text box, I cannot
get the short time in this format. It appears as 07:00:00.


Try using a custom format:

"Start Time: "h:nn ampm
 
Here is my exact text box source: ="First Tee Time: " &
[First_Tee_Time]

If I place "h:nn ampm in the format properties of the text
box, I still get the results of 07:00:00 am. I believe I
need to somehow incorporate the format directly into the
source of the text box shown above.

Thanks much.
 
try ="First Tee Time: " & format([First_Tee_Time],"h:nn ampm")

Here is my exact text box source: ="First Tee Time: " &
[First_Tee_Time]

If I place "h:nn ampm in the format properties of the text
box, I still get the results of 07:00:00 am. I believe I
need to somehow incorporate the format directly into the
source of the text box shown above.

Thanks much.

-----Original Message-----
07:00:00.


Try using a custom format:

"Start Time: "h:nn ampm
 
Here is my exact text box source: ="First Tee Time: " &
[First_Tee_Time]

If I place "h:nn ampm in the format properties of the text
box, I still get the results of 07:00:00 am. I believe I
need to somehow incorporate the format directly into the
source of the text box shown above.

Change the text box's Control Source to just:
[First_Tee_Time]

and set the its Format property to:
"First Tee Time: "h:nn ampm


If there's some reason you don't like that, use the
expression posted by Steven and forget setting the Format
property.
--
Marsh
MVP [MS Access]



 
Back
Top