requery repaint subform timing

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?
 
M

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top