Some fairly simple questions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Just a couple of questions for somebody.
1. When I update/change information on one subform, how can I make sure the
calculated value on the last subform is updated with the correct information.
For example, on subform A I increase a value for a Total_infractions and the
calculated value on subform F does not show the increase in value when the
field on Subform A is in the expression for Subform F. Would I put some
coding into the Open form command?
2. I have a calculated value that takes Value X and subtracts 5 from it as a
tolerance. If the tolerance is less than zero, I need the calculated value
to show zero instead of a negative number. How would I go about doing that?

Thanks in advance,
Todd
 
Just a couple of questions for somebody.
1. When I update/change information on one subform, how can I make sure the
calculated value on the last subform is updated with the correct information.

First, bear in mind that you cannot and do not change information in a
subform. You *USE* a subform (or form) as a *tool* to change the value
stored in a Table.
For example, on subform A I increase a value for a Total_infractions and the
calculated value on subform F does not show the increase in value when the
field on Subform A is in the expression for Subform F. Would I put some
coding into the Open form command?

Are these really *SUBFORMS*, that is, forms displayed within a Subform
control on a mainform? If so, you don't "open" subforms. It sounds
like you're opening separate, stand-alone forms instead. How are the
forms related?

If they are in fact subforms of some master form, you may need to
either Requery SubformF in the AfterUpdate event of SubformA; or use
the Recalc method on the main form to recalculate all of the
calculated fields on it and its subforms.
2. I have a calculated value that takes Value X and subtracts 5 from it as a
tolerance. If the tolerance is less than zero, I need the calculated value
to show zero instead of a negative number. How would I go about doing that?

IIF(X < 5, 0, X-5)

John W. Vinson[MVP]
 
Back
Top