473,387 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Time

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
Nov 12 '05 #1
8 1340
Mark wrote:
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?
--
Marsh
MVP [MS Access]
Nov 12 '05 #2
Mark wrote:
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

Nov 12 '05 #3
txtA & ":" & txtb & "PM"

or

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

"Mark" <mm*****@earthlink.net> wrote in message news:<0g******************@newsread3.news.atl.eart hlink.net>...
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

Nov 12 '05 #4
Marsh,

Thank you for responding to my question!
Did you really need to cross post this question to three groups?<<

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

"Marshall Barton" <ma*********@wowway.com> wrote in message
news:33********************************@4ax.com... Mark wrote:
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?
--
Marsh
MVP [MS Access]

Nov 12 '05 #5
"Mark" <mm*****@earthlink.net> wrote in
news:f8***************@newsread1.news.atl.earthlin k.net:
Did you really need to cross post this question to three groups?<<


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 ...

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #6
"Lyle Fairfield" wrote
sigh ...


Patience, I've heard, is a virtue, Lyle.

Perhaps you could work on being more patient-like in the New Year.
Nov 12 '05 #7
"Larry Linson" <bo*****@localhost.not> wrote in news:3F4Kb.49650$E17.15856
@nwrddc02.gnilink.net:
"Lyle Fairfield" wrote
sigh ...


Patience, I've heard, is a virtue, Lyle.

Perhaps you could work on being more patient-like in the New Year.


Naah ... Patience was a little blonde cheerleader in High School ... nothing
to do with virtue!

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #8
"Larry Linson" <bo*****@localhost.not> wrote in message news:<3F*******************@nwrddc02.gnilink.net>. ..
"Lyle Fairfield" wrote
> sigh ...


Patience, I've heard, is a virtue, Lyle.

Perhaps you could work on being more patient-like in the New Year.


To All CDMA Participants Old and New:

I've recently accepted Jesus Christ as my personal savior. I want to
become a "new" Larry Linson. Therefore I'm repudiating this post and
all of my posts to CDMA over these many years. Those posts were the
work of the "old" Larry Linson. He was a liar and a deceiver.

To all of you who've supported me I can only say I'm sorry for letting
you down. To all of you whose work I've stolen I say I will never do
it again. And to those of you I've slandered or hurt in some way I
hope you'll find it in your heart to forgive me.

Respectfully Yours,
(The New) Larry Linson
Nov 12 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bart Nessux | last post by:
am I doing this wrong: print (time.time() / 60) / 60 #time.time has been running for many hours if time.time() was (21600/60) then that would equal 360/60 which would be 6, but I'm not getting...
5
by: David Stockwell | last post by:
I'm sure this has been asked before, but I wasn't able to find it. First off I know u can't change a tuple but if I wanted to increment a time tuple by one day what is the standard method to do...
6
by: David Graham | last post by:
Hi I have asked this question in alt.php as the time() function as used in setcookie belongs to php - or does it belong equally in the javascript camp - bit confused about that. Anyway, can anyone...
3
by: Szabolcs Nagy | last post by:
I have to measure the time of a while loop, but with time.clock i always get 0.0s, although python manual sais: "this is the function to use for benchmarking Python or timing algorithms" So i...
6
by: Rebecca Smith | last post by:
Today’s question involves two time text boxes each set to a different time zone. Initially txtCurrentTime will be set to Pacific Time or system time. This will change with system time as we travel...
3
by: luscus | last post by:
Thanks for all the responses on my first question. Unfortunately the answers I was given were too complicated for my small brain , and neophite condition to understand. So if you could talk down to...
3
by: cj | last post by:
If I want to check to see if it's after "11:36 pm" what would I write? I'm sure it's easy but I'm getting tired of having to work with dates and times. Sometimes I just want time or date. And...
1
by: davelist | last post by:
I'm guessing there is an easy way to do this but I keep going around in circles in the documentation. I have a time stamp that looks like this (corresponding to UTC time): start_time =...
2
by: Roseanne | last post by:
We are experiencing very slow response time in our web app. We run IIS 6 - windows 2003. I ran iisstate. Here's what I got. Any ideas?? Opened log file 'F:\iisstate\output\IISState-812.log'...
9
by: Ron Adam | last post by:
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.