recalc subform after orderBy

cpampas

Registered User.
Local time
Today, 12:40
Joined
Jul 23, 2012
Messages
221
Hello,
Can you help me understand this :
I do have in my mainForm a control that gets the value of a control in mySubForm footer:

1 - control [sa], in subforms footer : = Avg(Val([anoMaq]))
2 - control [tAno], in myMainFrom =[frmB].[Form]![sa]

it works fine until I run the following code


Code:
Me.OrderBy = "[anomaq]"
    Me.OrderByOn = True

wich orders records in my subform by the field anoMaq . after it executes the value in the textbox control [tAno] in MainForm vanishes
I tried to requery both forms after the orderBy, but still with no results

Code:
Me.OrderBy = "[anomaq]"
    Me.OrderByOn = True
   Me.Form.Requery  ' to requery the subform
   Me.Parent.Requery   ' to requery the main form

I appreciate your help
 
Did you also try using Recalc?
 
hi theDBguy,
i was trying requery, and refresh, but not recalc
it solved the problem, many thanks for you r kind help
 
hi theDBguy,
i was trying requery, and refresh, but not recalc
it solved the problem, many thanks for you r kind help
You're welcome. It's funny how you titled your topic "recalc," and it's what helped you fix the problem. Good luck with your project.
 
😂😂 you are right i hadnt notice that. the brain works in misterious ways
 

Users who are viewing this thread

Back
Top Bottom