Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Event

Status
Not open for further replies.

hoofit

Technical User
Nov 20, 2005
343
US
I have a db used for tracking employee hours. Time is broken down into categories ie; regular, OT, sick, vacation etc. I have the following number settings for the categories;

Data type; number
Field size; single
Decimal places; 2
Default value; 0

As I enter data, I would like to have a running total shown in a “week total” field. Seems like I’ve gone thru all of the events that would trigger this (on load, on current) for the form and I see no on load or on current event for the field. Only way I can get a running total is to close the form then reopen it. My code for the on current event of the form is;

Private Sub Form_Current()
Me.SubtotalFirstWeekHours = Me.Hours1 + Me.Hours2 + Me.Hours3 + Me.Hours4 + MeHours5 + Me.Hours6 + Me.Hours7
End sub

I’ve tried a requery but it’s really slow and still is not triggered at the right time. Any thoughts would be appreciated

Thank you
 
I don't care for your un-normalized table structure. However, is there a date associated with the time? Is it for a single day or a week? Can't you use a text box with a control source like:
Code:
= Me.Hours1 + Me.Hours2 + Me.Hours3 + Me.Hours4 + MeHours5 + Me.Hours6 + Me.Hours7


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top