Automatic time calculation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • antonisg
    New Member
    • Apr 2010
    • 3

    #1

    Automatic time calculation

    I have created a form and I have a field "time". When i enter a time i want in another field to autocomplete the time i entered previously +45 minutes. for example

    Enter 15:20 and the result is 16:05
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    I suggest the simplest solution is to have an unbound control (not field) on your form with a formula of :
    Code:
    =[Time]+#0:45#

    Comment

    • antonisg
      New Member
      • Apr 2010
      • 3

      #3
      I want to enter the time and to be calculated automatically. how it will "read" the time I give?

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        If you have a control on your form called [Time] (as you appeared to indicate in your first post - albeit referring to it as a field) the the formula includes a reference to that control as [Time]. I should mention at this point that naming anything as [Time] is highly dubious in itself as it's a reserved word and they should be avoided for names, but regardless of the name, the idea should work for you.

        Comment

        • antonisg
          New Member
          • Apr 2010
          • 3

          #5
          i call it departure_time because time is a reserved word. I want to have an arrival time which is plus 45 min. I tried the expression you told me but it auto corrects to 12:45:00 pm.

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32669

            #6
            What expression did you use exactly?

            If you used what I posted with no amendment then that is exactly what you'd expect. That was for the name as you'd posted it earlier (Remember - my mind-reading powers should never be relied upon too heavily).

            Comment

            • hedges98
              New Member
              • Oct 2009
              • 109

              #7
              atonisg - It sounds like you are putting NeoPa's suggested code in the departure_time field. Don't do this, add an unbound control (textbox I assume) and enter NeoPa's code into that:
              Code:
              =[departure_time]+#0:45#

              Comment

              Working...