Creating Summary Calculations

P

ptlm65

I need to make a simple query that allows me to update data in one fiel
and have the total change in another field.

I have three tables:

Hours given
Hours Served
Hours Remaining

I need to update when someone serves more hours and have the quer
subtract the new hours served from the hours given and automaticall
enter it into hours remaining. Can anyone help? Thank
 
M

[MVP] S.Clark

The question is when? When should the update occur?
Your answer will probably be, "When I enter either the given or served."
Which begs how. How are you entering it?
[Yes, I talk with the voices in my head, too. When they finally stop
yelling that is.]

So...

If you enter data in a table, then you will just have to run the update
query manually, when you finish your session.

If you enter data in a form, then in the AfterUpdate of the form(or for the
given or served fields) you would either update the remaining field or
trigger the update query.

The update query would look something like:

Update tablename set Remaining = Given - Served.

The AfterUpdate code would look something like

txtRemaining = txtGiven - txtServed.
 
Top