Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Form Footer Calculation
David Clement 
      
19 hours ago
Good morning, Richard.
I have made what I am calling a Wellness Log. For tracking daily health vitals. It has been working fine until this morning. Can you please tellme how my form footer total can go from this, =Avg([BloodPressure]) to this,
=Round(Avg(Val(Left([BloodPressure],InStr([BloodPressure],"/")-1))),0) & "/" & Round(Avg(Val(Mid([BloodPressure],InStr([BloodPressure],"/")+1))),0)

I didn't chanage or enter it this way. What could have happened?
Like I said, it was working fine and has been working fine for almost a month.
It also messed up other From Footer totals. All I get now is #Error in all totals.
Very Confusing.
Richard Rost  @Reply  
          
19 hours ago
Good morning, David. Access did not randomly convert =Avg([BloodPressure]) into that much more complicated expression on its own. Something had to save a design change to that control - either an accidental edit in Design View, VBA code that modifies ControlSource, an import/restore of an older object, or possibly database corruption. That exact expression looks like someone was trying to calculate separate averages for the systolic and diastolic portions of a value such as 120/80.

Also, =Avg([BloodPressure]) will only work properly if BloodPressure is a numeric field. If BloodPressure contains text like 120/80, Access can't average it as a single number. The longer expression is attempting to split the text at the slash and average each side separately.

The bigger issue is that BloodPressure really should not be stored in one text field. I would use two Number fields instead:

Systolic
Diastolic

Then your footer controls are simple and reliable:

=Round(Avg([Systolic]),0)

=Round(Avg([Diastolic]),0)

And if you want to display them together:

=Round(Avg([Systolic]),0) & "/" & Round(Avg([Diastolic]),0)

For now, make a backup copy of the database first. Then check the affected footer controls in Design View and look at each ControlSource property. If they all suddenly changed, I would also run Compact and Repair Database. But I would be very surprised if Access itself generated that particular formula.
David Clement OP  @Reply  
      
18 hours ago
Blood Pressure Field is set as a Text Field, and it appeared to work just fine until I entered this mornings readings, then, boom!, it was broken. I do not rember doing anything other than enter today's data.
Richard Rost  @Reply  
          
14 hours ago
That makes sense. The expression probably encountered a value that it couldn't parse correctly this morning. For example, a blank BloodPressure value, a missing slash, extra spaces, or anything other than the normal format such as 120/80 can cause InStr, Left, or Mid to produce an error. Once one record causes an error, the aggregate calculation in the footer can show #Error.

Open the table and carefully inspect today's BloodPressure entry, plus any records entered around the same time. Make sure they all follow the exact same format:

120/80

No blank values, no extra text such as "120 / 80", and no entries like "120-80".

That still doesn't explain why the ControlSource itself changed from =Avg([BloodPressure]) to the longer formula, because Access would not make that change just from entering data. But the longer formula is likely what is now failing because of a bad or unexpected BloodPressure value.

Ultimately, splitting this into Systolic and Diastolic Number fields will eliminate this whole class of problems.
Richard Rost  @Reply  
          
14 hours ago
Watch Fitness 66 where I actually set this up.
David Clement OP  @Reply  
      
14 hours ago
Thank You!
Add a Reply Upload an Image
Next Unseen

 
 
What's This?

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 9/20/2026 5:29:14 AM. PLT: 1s