requery repaint subform timing

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

Guest

Using Access 2000. Trying to test a calculated value on a subform after
changing an item on a mainform. It essentially counts the details of the
subform. I cannot get the correct value to be tested always returning zero
for the test, but the correct value is displayed when run in debug. Various
combinations of repaint, requery, refresh have not helped. How can I force
it to test the control after it contains its new value?
 
Apmarg said:
Using Access 2000. Trying to test a calculated value on a subform after
changing an item on a mainform. It essentially counts the details of the
subform. I cannot get the correct value to be tested always returning zero
for the test, but the correct value is displayed when run in debug. Various
combinations of repaint, requery, refresh have not helped. How can I force
it to test the control after it contains its new value?


You do NOT want to go there! The timing of Access control
calculations is always slower than VBA code execution.

Try to find a way to use VBA (probably in the main form
control's AfterUpdate event) to perform the subform
calculation.

That's not practical for aggregate functions (Count, Sum,
etc) so, in this, case it's better to just forget using VBA
at all and use another expression in a main form text box
that refers to the subform value.
 
Back
Top