+ Reply to Thread
Results 1 to 12 of 12

Automatic time format in form field?

  1. #1
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Automatic time format in form field?

    Hello again!

    How can I have a form field automatically fill some aspects of the data that's input? I've seen it before, like a phone# field automatically including the dashes.

    I would like to automatically include colons in a time field. So if I were to type "081500" (or even "81500"), it would complete it as "08:15:00".

    Any ideas? Thanks!
    Willys
    Last edited by WillysK5; 03-11-2009 at 11:57 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatic time format in form field?

    Are you referring to a cell on a sheet?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Re: Automatic time format in form field?

    Nope, a form field.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Automatic time format in form field?

    Hello WillysK5,

    Your terminology doesn't fit with any of Excel's objects. Are your referring to a Word Document? If not, you need to explain what a form field is.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Re: Automatic time format in form field?

    Ok, here goes. By "form field" I mean a text box within a form.

    The data input into that text box is put into a cell formatted as time (37:30:55). So rather than asking the user to type the colon when putting the time in that text box, I was hoping that could be automatic and all they would need to type are the 4 or 6 numbers. If I don't type in the colons now, it puts the time in as hours:, and not hours:minutes:seconds.

    I'm also hoping to adapt that for a date input by having the "/" automatic.

    Is that clearer? I hope...

    Thanks!
    Willys

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatic time format in form field?

    A UserForm?

    If four digits are entered is this padded out with zeros, ie 2358 becomes 02:30:08?
    Last edited by royUK; 03-11-2009 at 11:18 AM.

  7. #7
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Re: Automatic time format in form field?

    Quote Originally Posted by royUK View Post
    A UserForm?

    If four digits are entered is this padded out with zeros, ie 2358 becomes 02:30:08?
    Yes, a userform.

    Right now, if I put 2358, it comes out as 2358:00:00.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatic time format in form field?

    2358 could be 02:35:08 or 23:58:00, what determines the split?

  9. #9
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Re: Automatic time format in form field?

    Quote Originally Posted by royUK View Post
    2358 could be 02:35:08 or 23:58:00, what determines the split?
    I'm pretty flexible with this. I said 4 digits because I thought maybe by putting 1130, it could come out as 11:30:00. Maybe it will need the user to input 6 just to have the 2 characters per time increment, like 113015 to be 11:30:15, or 113000 to be 11:30:00?

    I know it may not seem like much time is saved by doing this, but if they don't have to pull their hand of the keypad, it should be quicker.

    Thanks!
    Last edited by WillysK5; 03-11-2009 at 11:41 AM.

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatic time format in form field?

    using the TextBox exit event
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Re: Automatic time format in form field?

    WOOHOO!! Works great!

    Thanks Roy!

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Automatic time format in form field?

    If you are satisfied with the solution(s) provided, please mark your thread as Solved and rate the answer(s).

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1