Question Locked

ACCESS: Calculate a Total in a FORM

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Ok in a form I have 6 fields. The first four fields I want to add and then subtract the last two from that giving me a calculated total upon changing any of the 6 fields in the 7th (or total) field.

3 replies

by larryd4

You could either write in a command for the default value of the 7th field, such as.
=[Field1]+[Field2]+[Field3]+[Field4]-([Field5]+[Field6])
But with the above you have to stimulate the calculation with an onFocus event.

Or you can simply write a VBA Macro for the onEnter event for Field7 that would look something like

Field7.value = Field1.value + Field2.value etc...

by vdanelia

Thank You for such smart and very useful example

This discussion is closed to new replies.