Delay in Summing on a form

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

Guest

Hi all,

I hope someone has an answer to this! I've tried to find one, with no luck.

I have a form, that is for adding an existing training event to another
client.
The training event can be used by several clients.
When I add it to another client, i want it to intially offer the average of
what the other clients on that event have been charged, to charge this new
client.
I have a subform, that lists all the clients that use this event, and how
much they have paid. In the footer I have a SUM textbox to get the total
amount paid for the event, and an AVG textbox to give the average client
payment. This field is hidden on the subform.

Back on the main form, it has event cost - which i want to update from VB
just when the form is first opened, allowing the user to change the value if
they want. Then it has a travel cost for the event, and a Total Cost - event
cost + travel cost.

Because of the delay in working out the SUM and AVG boxes, the total box
only adds up the travel - because the AVG hasn't been worked out yet.

How do i get the form to work how I want.

I hope this is clear, and someone can understand and help me do this,

Thanks in advance,
Chris
 
Hi,


Have you tried to force a recalculation: Me.Recalc


That is assuming your formula is like:


=DAvg("amount", "tablenameHere", "eventID=" & Me.EventID) + travelCost


to a control.


Alternatively, you can compute it in some VBA code and push the result:

' somewhere
Me.ProposedCost = DAvg( ... ) + TravelCost



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top