Time

  • Thread starter Thread starter Mark
  • Start date Start date
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
 
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?
 
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])
 
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
 
txtA & ":" & txtb & "PM"

or

Format(txtA & ":" & txtB & txtC, "hh:mm") will give you 14:55
 
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
 
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 ...
 
Back
Top