This seems perfectly clear to me, and is the way I understood it before.
Did you try what I suggested? If the control in question is a calculated
control (i.e., its controlsource begins with "="), then recalculating the
form with Me.Recalc should cause it to be recalculated. If you are opening
your form in dialog mode (using the WindowMode:=acDialog argument to
OpenForm), then the code in the calling form will wait until that form is
closed or made invisible before proceeding, so whatever code you eventually
use to recalculate the field can simply be placed after the DoCmd.OpenForm
call, and it will be executed when that form is closed.
It is possible, I suppose, that you might need to refresh or requery your
form after the modal form is closed, and then recalculate, depending on what
your modal form is actually doing and what sort of calculation is giving
your field its value. Or if your "calculated" field really isn't a
calculated field in the technical sense at all, but has a value assigned to
it by a calculation and assignment you perform in code, then you'll need to
perform that calculation and assignment again.
If my suggestion didn't work, maybe you could post the controlsource
expression of the field, or the code that calculates and assigns a value to
it.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Quote:
> Sorry this is so complicated to describe. The problem is not with the
modal
> form for editing the records. Its the field in the form underneath that
> needs to get recalculated when the modal form is exited. The modal form is
> used to manipulate the set of records that are summed to establish the
value
> of the lower-level field. When the modal form has completed modifying the
> records and is exited, the original field, which still has the focus,
needs
> to be recalculated. The prob seems to be in firing off an event that I can
> use to update the field. This isn't happening because the focus of the
> original field is never lost or changed by the modal form.
> Clear as mud?
> :-)
> > Does issuing a Recalc on the form do the job? E.g.,
> > DoCmd.OpenForm "YourModalForm", WindowMode:=acDialog
> > Me.Recalc
> > --
> > Dirk Goldgar, MS Access MVP
> > www.datagnostics.com
> > (please reply to the newsgroup)
> > > I have a field on a form whose value is determined by function that
does
> a
> > > summation query on a set of records in a table. If you enter this
field,
> a
> > > modal form is invoked that lets you modify the records that were the
> basis
> > > of the value in the field. When you exit the modal form, the focus is
> > still
> > > set to the original field. I'm trying to figure out how get the field
to
> > > automatically update by re-invoking the function. I've played around
> with
> > > just about all of the events for the field with no luck. For example,
it
> > > will update correctly if you shift focus to another field on the form
> but
> > > that's not good enough. Is there an easy way to do this?
> > > Thanx,
> > > Garth