Defaulting Times in a timesheet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jacc14
    New Member
    • Jun 2007
    • 116

    #1

    Defaulting Times in a timesheet

    I have done a simple datasheet which captures the job events in a shift.

    Simply

    Title Workcode Start Finish
    xxx Waste 16:32 17.00


    Basically i am trying to make it so that when the next line is entered it defaults the start time by looking at the last finish time and adding a min. In this case the next start time will show 17:01. that way i will capture all events in a shift. My fields are Date/Time format .
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    If you are sitting down and entering one record after the next, without the form being closed between entries, you can use:
    Code:
    Private Sub Finish_AfterUpdate()
     Start.DefaultValue = """" & DateAdd("n", 1, Me.Finish) & """"
    End Sub
    Linq ;0)>

    Comment

    • jacc14
      New Member
      • Jun 2007
      • 116

      #3
      Hi Thanks for that I will give it a go. However at times the user may log out of the program to do something else as he will keep returning to do this throughout the day.

      thanks
      Chris

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        Hi Christine. Is this an Excel question? It really helps to say so explicitly as many terms are similar and it could be confused for an Access one. Particularly in an Access forum. I believe Linq's suggestion is based on the premise that it's Access related.

        We can probably help too, if it's Excel, but we'd need to know before suggesting a solution.

        Comment

        • jacc14
          New Member
          • Jun 2007
          • 116

          #5
          Hi there. It is a msaccess problem. sorry i didnt make it clear. Thanks

          Comment

          • jacc14
            New Member
            • Jun 2007
            • 116

            #6
            Originally posted by missinglinq
            If you are sitting down and entering one record after the next, without the form being closed between entries, you can use:
            Code:
            Private Sub Finish_AfterUpdate()
             Start.DefaultValue = """" & DateAdd("n", 1, Me.Finish) & """"
            End Sub
            Linq ;0)>
            Thank you for your report. I have tested this and it works a treat.

            Best regards
            Christine

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32669

              #7
              No worries Christine. I must have misread it. It might have been a problem if at had been an Excel issue and you hadn't mentioned it

              Comment

              • missinglinq
                Recognized Expert Specialist
                • Nov 2006
                • 3533

                #8
                Glad we could help, Christine!

                Linq ;0)>

                Comment

                Working...