Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format textbox_exit as time "h:mm"

Status
Not open for further replies.

davedave24

Programmer
Aug 26, 2010
113
GB
Code:
    textTime = Format(textTime, "h:mm")

This code in the _exit event of the textbox makes the textbox display 0:00. How do I correctly format the user's input to time, so they can type in '1245', and the textbox converts it to '12:45'?
 



Hi,

The Format function converts Date/Time values, which are NUMBERS, to TEXT.

Your argument is already text!!! It wants a REAL TIME value!

You ought to have a textbox for hours and a textbox for minutes, because you have no controil over what the users will enter. With two textboxes, you can at least test for NUMBERS within limits.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top