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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enter times without colon

Status
Not open for further replies.

StrikeEagleII

Technical User
Oct 4, 2006
57
US
One form I'm working on requires a start time and stop time that will be used to find the number of hours a job took. Is there a way to enter the time in the format hhmm, e.g. without the colon? I tried using a mask, but even with that you have to enter the colon--it's only after you tab off the field the colon disappears. The text box is formatted as short time.
Thanks,
Jason
 
What input mask do you have?

00:00;0;_

Works for me.
 
How are ya StrikeEagleII . . .

You can set the [blue]data type[/blue] in the table/form to text, [purple]however you loose a great amount of functionality thereof:[/purple]
[ol][li]Validation will require more coding to take care of typo's![/li]
[li]The time has to always be converted for proper use . . . sorting, comparison . . . ect).[/li][/ol]
I don't mind coming up with all kinds of magic for the customer but this is one area I would save myself the trouble and give a class on entering time. Otherwise its gonna cost as an expensive special since time as text will ripple thru the entire db where its used! Given the option all my clients where time was involved in the past have chosen classes!

[blue]There are those things in any db that are worth getting paid for![/blue] . . . This is one of them for me!

Besides . . . [purple]whats so wrong with the colon anyway?[/purple] Non-savy computer people can look at it and tell you the time! . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 




Hi,

You have to realize what happens when you enter TIME data.

FIRST, Time VALUES are just NUMBERS; numbers less than 1 and greater than or equal to ZERO.

So when you enter a value like 8:03, it is TEXT, that the interface manager PARSES on the COLON, into HOUR, MINUTE and SECOND, then CONVERTING to Time using those value in a TimeSerial Function.

You would have to somehow intersept and override the interface manager to make it do something other than what it is designed to do. I'd venture a guess that that is not possible.

However, you could design your own textbox in a Form to enter the data that way, and program the conversion of the text value yourself.

Skip,

[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FORTH[/red] on the [red]FIFTH[/red]
[red][highlight blue]FORTH[/highlight][/red][white][highlight red]WITH[/highlight][/white] [tongue]
 
Howdy SkipVought . . .
SkipVought said:
[blue]You would have to somehow intersept and override the interface manager to make it do something other than what it is designed to do. [purple]I'd venture a guess that that is not possible.[/purple][/blue]
I've already done so in the past for two clients. One client was caught in a year end crunch and had to pay the price, the other finally saw what I was trying to tell him all along and paid as well. There were others but the price was forbidding.

Its really not so bad ([blue]more tedious than anything else[/blue]) depending on how far time reaches into the forms/reports.

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 




Interesting...

Skip,

[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FORTH[/red] on the [red]FIFTH[/red]
[red][highlight blue]FORTH[/highlight][/red][white][highlight red]WITH[/highlight][/white] [tongue]
 
I guess what I had was the textbox format set to hhnn and no input mask, which would display the time as 1345, but you'd still have to enter it as 13:45. The input mask 00:00;0;_ works great. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top