Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

How have field recalculate on form #1 when form #2 closes

I have a field on form #1 named "txtTotOPcost".  This is a calculated field and the control source is...  =Nz(DSum("[Cost]","tblOutpurchase","[EstN] = " & Chr(34) & [Forms]![frmEstimateHeader]![txtRealEstN] & Chr(34)),0)

When form #2 closes (record source for that form is "tblOutpurchase" I want the field named "txtTotOPcost" on form #1 to recalculate and show the sum total values of "Cost" in "tblOutpurchase".

I can't figure out how to make it recalculate or refresh or whatever I need to do to make the value show up.  If I close form #1 and reopen it the value does display correctly.

--Steve
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

use this code

Forms!FormNumber1Name.recalc
FormNumber1Name is the name of form #1
Avatar of kelle1
kelle1

Create an On Close Event on form #2 that says

Forms!Form#1.Requery
Avatar of SteveL13

ASKER

I have tried both possible solutions and neither one works.
ASKER CERTIFIED SOLUTION
Avatar of Nick67
Nick67
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
so, what happened to the original post of RECALC
http:#a35797780
@SteveL13
You could click request attention and ask to redistribute the points.

<@kelle has the right spot to put your code, in the Close event of Form #2
@capricorn1 has the right syntax.>

They deserve some share, the lion's share, of the points for the solution.

Nick67