Calculate time on form with 4 shifts, lunch, and total on Access Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jforbes
    Recognized Expert Top Contributor
    • Aug 2014
    • 1107

    #31
    That is interesting.

    I'm not 100% sure of what happens when you move to the next record. Are you moving to a different physical record in the database? Also, is the Form's DefaultView Property set to Single Form or Continuous Forms? Continuous Forms and Unbound Fields don't get along very well.

    Also, I assumed that the Total Hours that you want to display is for the whole two weeks. Is this correct, or is there supposed to be a Total for each week?

    My guess is either lTotalHours isn't getting reset at the right time or it's getting set from the from the Form after it has been created.

    Last thing you could do is to repost what code you are using.

    Comment

    • alexrubio
      New Member
      • Feb 2015
      • 50

      #32
      Ok, I'm using Single Form and this happens when I click the right arrow at the bottom of the record to go into a new record.

      You are correct about the totals, I need a full total for the two weeks.

      The code is the same as is on post #28, plus the changes you added on your post #29.

      Let me know if you need additional info...

      Comment

      • alexrubio
        New Member
        • Feb 2015
        • 50

        #33
        I think I finally found the culprit...! Don't understand why it would affect it that way, but for some reason it was...

        The unbound field called txtTotalHours was once bound to TotalHours, before I inserted your code, I unbound it and changed its "Other" name to txtTotalHours, I had some other code to change font color and field lock status... I had forgotten to change that code to reflect the new name...

        Here is that code:
        Code:
        Me.TotalHours.BackColor = vbRed
        Me.TotalHours.ForeColor = vbRed
        Me.TotalHours.Locked = True
        When I changed the above to "txtTotalHo urs" it worked immediately...

        SO once again, you are the main man and got it working as usual, thanks a mill!

        Sorry for the confusion!!!

        Comment

        Working...