Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count(), Sum() Inaccurate

Status
Not open for further replies.

EriRobert

MIS
May 9, 2003
114
GB
Hi,

I have a problem whereas the Count() and Sum() functions are inaccurate:

On a continuous form I am showing about 5000 records. In the form footer section I am showing totals and Counts:

Sum(BD_Amount)
Count(BD_No)

Pretty standard stuff. If I DO show navigation buttons then Sum and Count are correct. However if I DON'T show navigation buttons then the Count and Sum are wrong (Count about 250 - varies time to time). All records (5000) are shown correctly on form.

I can understand that Access is trying to be clever by giving up on counting because it thinks it doesn't have to (because no navigation buttons). How can I persuade Access to continue counting/summing without showing navigation buttons?


 
The count is probably coming from some database setting that limits the number of records. Look at the options set for the database (under Tools menu).


I would use a stored procedure and assign the output parameter value to the textbox.
 
Hi

I don't think this is a setting limit as the records are shown correctly - just the sum and counts are incorrect (besides the Max Default setting is 10,000 - more than enough).

Anyway I have now got a work around.

The key to this is the Navigation Buttons, which I don't want to show on the form. However hiding them screws up the counts/sums. Therefore in design I set Navigation Buttons to Yes, and on the Open event of the form add code to hide them:

Form.NavigationButtons = False

This seems to solve my problem.

Thanks for your help anyhow.
 
I am glad you found a solution. I do not work with continuous forms very often, and try not to rely on Access to do much for me. It will usually get me in the end!

neecie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top