Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 393
  • Last Modified:

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
0
psatkar
Asked:
psatkar
1 Solution
 
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
 
KarramliCommented:
Try in the Current_Event of the form to use

     Me.Form.Recalc

0
 
psatkarAuthor Commented:
Thanks Karramli,
I have added Me.Form.Recalc in OnLoad event of this form and it has done the trick.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now