Results 1 to 11 of 11
  1. #1
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Time Input Masks (Any)

    I don't use input masks much, but I do like them for dates and times, as they avoid the need for typing the / and : etc.

    So for times I often use 00:00 >LL;1;_ when the resulting time will be displayed as 11:15 AM or 2:30 PM.
    For data entry this seems to work fine, but if someone has entered 2:30 PM and wants to go back and change it to 3:30 PM , the mask forces them to retype the leading 0, which is then discarded.

    So I want to change the mask to make it easier to edit an existing time.
    I thought 90:00 >LL;1;_ should work, making the leading digit optional, but it does not, and I don't know why.

    In the example below I have just replace a leading 2 with a 3. If I type 03 it works.
    Attached Images Attached Images
    Regards
    John



  2. #2
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Time Input Masks (Any)

    09:00 >LL;1;_ or 99:00 >LL;1;_ will work. It looks odd when the hour is edited. Instead of _2:30 PM it appears as 2_:30 PM, but the time is stored correctly when the field is exited.

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Time Input Masks (Any)

    Thanks for that. I would have to try that with users, to see if they think that is an improvement. Is this something you use?

    I have just had another idea, which seems to work as well. Use code to remove the mask for existing records.
    <pre>Private Sub Form_Current()
    If Me.NewRecord Then
    Me.StartTime.InputMask = "90:00 >LL;1;_"
    Me.EndTime.InputMask = "90:00 >LL;1;_"
    Else
    Me.StartTime.InputMask = ""
    Me.EndTime.InputMask = ""
    End If
    End Sub
    </pre>

    Regards
    John



  4. #4
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Time Input Masks (Any)

    >Is this something you use?
    No - only because my use of Access is data mining and manipulation of the data, not table building through forms.

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Time Input Masks (Any)

    What i normally do is to force the user to input 2 chars for the day and the month.

    So when they go and change a date, they always enter the 2 chars for day and month.

    It's trying to force a habit I guess.

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Time Input Masks (Any)

    For Dates I do much the same - force them to input 6 numbers.
    But Dates keep the leading zeros, so you can edit a single digit of an existing date without violating the mask.

    But I have a little job at the moment where lots and lots of times need to be entered, and they find editing them a bit cumbersome, and keep getting error messages about the mask. But they don't want me to get rid of it altogether. I think the code in the on Current event will do the trick.
    Attached Images Attached Images
    Regards
    John



  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Time Input Masks (Any)

    can theyjus enter the day and month and have access assume the current year?

    I thought i have seen this before.

    Would that help their data entry?

  8. #8
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Time Input Masks (Any)

    This is not about Dates Pat, it is about Time.
    Regards
    John



  9. #9
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Time Input Masks (Any)

    Sorry about that.

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Time Input Masks (Any)

    I *never* use input masks for dates and times. My users have a mixture of date and time settings: US English, UK English, Dutch. An input mask causes problems if it doesn't conform to the user's system settings.
    So I either let the users enter the complete date or time, or I use separate boxes for day, month, etc.

  11. #11
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Time Input Masks (Any)

    Yes I have seen you say this before.
    Here in Australia we all use the same date and time settings, and my users complain to me if I forget to put the mask in.
    Regards
    John



Posting Permissions

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