T
Tim Richardson
In my main form I have a text box which shows the "amount" total of the
records in the subform.
When I navigate to a new header record (the main form) I would like
this subtotal to update to reflect the new records loaded into the
subform.
The unbound total text box uses a Dsum expression.
In my subform I get this to change correctly if the amount field in any
of subform records is changed, by code on the losefocus event which
does a refresh and then a requery on the unbound text box. This works
fine.
But when I navigate to new records in the main form, I don't know how
to make this total value update. At the moment I have on the "current"
event of the main form the code
me!journalTotal.requery
but this is not working even though I can see that this event is being
called whenever I naviate to a new record in the main form. So the
event is ok. And requerying that unbound control works when I do it in
the subform. It just doesn't work when I do it in the main form.
records in the subform.
When I navigate to a new header record (the main form) I would like
this subtotal to update to reflect the new records loaded into the
subform.
The unbound total text box uses a Dsum expression.
In my subform I get this to change correctly if the amount field in any
of subform records is changed, by code on the losefocus event which
does a refresh and then a requery on the unbound text box. This works
fine.
But when I navigate to new records in the main form, I don't know how
to make this total value update. At the moment I have on the "current"
event of the main form the code
me!journalTotal.requery
but this is not working even though I can see that this event is being
called whenever I naviate to a new record in the main form. So the
event is ok. And requerying that unbound control works when I do it in
the subform. It just doesn't work when I do it in the main form.