Time

M

Mark

If I have "2" In A textbox, "55" in a second textbox and "PM" in a third
textbox, how can I put them together into a single time value of 2:55 PM?

Thanks!

Mark
 
M

Marshall Barton

Mark said:
If I have "2" In A textbox, "55" in a second textbox and "PM" in a third
textbox, how can I put them together into a single time value of 2:55 PM?


CDate(textbox1 & ":" & textbox2 & textbox3)

Did you really need to cross post this question to three
groups?
 
J

John Vinson

If I have "2" In A textbox, "55" in a second textbox and "PM" in a third
textbox, how can I put them together into a single time value of 2:55 PM?

Thanks!

Mark

Try:

DateValue(Format([A],"00") & ":" & Format(,"00") & " " & [C])
 
S

Salad

Mark said:
If I have "2" In A textbox, "55" in a second textbox and "PM" in a third
textbox, how can I put them together into a single time value of 2:55 PM?

Thanks!

Mark

Sub TimTest()
Dim X as Integer
Dim Y As Integer
Dim Z As String
Dim d As Date
x = 2
y = 55
z = "AM"
d = x & ":" & y & " " & z
msgbox d & " " & format(d,"hh:nn")
End Sub

Change z to PM to see the change to PM...the hour will be 14
 
R

Roger

txtA & ":" & txtb & "PM"

or

Format(txtA & ":" & txtB & txtC, "hh:mm") will give you 14:55
 
M

Mark

Marsh,

Thank you for responding to my question!

Yes, as a matter of fact! There are many expert regulars at CDMA and usually one
can rely on getting a solution here. However, I always like to post my questions
on MPA GettingStarted also to see if John Vinson responds. When he responds, he
usually has an unique solution and you can rely on it to work. I have a high
respect for John!!

Mark
 
L

Lyle Fairfield

Yes, as a matter of fact! There are many expert regulars at CDMA and
usually one can rely on getting a solution here. However, I always like
to post my questions on MPA GettingStarted also to see if John Vinson
responds. When he responds, he usually has an unique solution and you
can rely on it to work. I have a high respect for John!!

sigh ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top