Sum field in form footer does not refresh

Hello,

I have a very simple Continuos Form based on a query displaying 8 columns. One of the column displayed is "Account_Balance". In the form footer, I have a textbox control with control source defined as =sum([Account_Balance]).

When the form is opened, the text box in the footer remains blank. However, If I switch between open windows (using Alt+Tab), the field is found to be updated when I bring the focus back to MS Access window!!!

Has anyone encountered problem like this?

Thanks and regards,
--Prasad
psatkarAsked:
Who is Participating?
 
KarramliConnect With a Mentor Commented:
Try in the Current_Event of the form to use

     Me.Form.Recalc

0
 
harfangCommented:
Hello,

I have, but only in forms with some complex code behind them. You say that the form is "very simple", but is it used a subform? is it a dialog box? do you have any code behind it? how many records does Access need to Sum()?

This is an idea: if you are summing 100000 records, or if your query is complex or not very optimized, Access can very well display the first record quickly, but take some time to compute the total. Try to display the navigation buttons, and check how long it takes for the record count to appear.

In code, you can force the refresh with Me.Refresh (identical to F9).

(°v°)
0
 
psatkarAuthor Commented:
Thanks Karramli,
I have added Me.Form.Recalc in OnLoad event of this form and it has done the trick.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.