Working with Timesheet Form

Technics

Member
Local time
Today, 11:06
Joined
Aug 9, 2025
Messages
53
Hi all,

Wanted to see if I could get some help with this. As you can see in photo I have date/time totals which provide footer totals. I am using basic math in the form query to get these footer totals. Expressions listed. This is all working correctly giving me all correct totals. The problem, hope photos illustrate, is I get no totals until I close and reopen the form. I am trying to figure out if there is a way for the footer totals to show without having to close and open the form.

Query math:
TotalMinutes: DateDiff('n',[StartTime],[EndTime])
HoursWorked: Round([TotalMinutes]/60,2)
WholeHoursWorked: Int([HoursWorked])
MinutesLeft: [TotalMinutes]-([WholeHoursWorked]*60)
Duration: [WholeHoursWorked] & ":" & Format([MinutesLeft],"00")

2timesheet.jpg
 
Last edited:
can you issue Requery on those 3 Textbox on the Footer, like:

Code:
Private Sub Form_Current()
[TotalMinutesTextbox].Requery
[TotalHoursTextbox].Requery
[TotalHoursMinutesTextbox].Requery
End Sub

on you can use the Form's Current event.
 
can you issue Requery on those 3 Textbox on the Footer, like:

Code:
Private Sub Form_Current()
[TotalMinutesTextbox].Requery
[TotalHoursTextbox].Requery
[TotalHoursMinutesTextbox].Requery
End Sub

on you can use the Form's Current event.
Thanks arnelgp. Requery is what I have been looking at and trying but was not sure exactly how to implement. I tried your code with 3 or 4 variations of textbox names but could not get anything to work. The actual textbox names are SumTotalMinutes, and SumDuration. Even tried it in Forms After Update.
 
The way I did it in my Diabetes DB was to have a sub called CalcTotal and called that on any AfterUpdate event of the controls that would affect the total.
 
Thanks arnelgp. Requery is what I have been looking at and trying but was not sure exactly how to implement. I tried your code with 3 or 4 variations of textbox names but could not get anything to work. The actual textbox names are SumTotalMinutes, and SumDuration. Even tried it in Forms After Update.
Me.SumTotalMinutes.Recalc and Me.SumDuration.Recalc
used in the After Update Event for each of the controls that affect the totals.
 

Users who are viewing this thread

Back
Top Bottom