Sum on subform #Error (1 Viewer)

TMullins

Registered User.
Local time
Today, 15:25
Joined
Apr 21, 2018
Messages
19
[SOLVED] Sum on subform #Error

I've been searching the forum for something similar to the problem that I'm having without any luck, so I'm going to do my best to explain my problem and see if anyone can please help.

I started my project with the students database template that comes with Microsoft Access. I created a tab called Summary and I'm trying to get a summarized total of total hours and grades on this tab.

I currently have a students table, yard table and road table. This is for a driving school and we have to keep track of hours and grades on separate cards.

When I try to sum the hours =Sum([Hours]), I get an #Error when I attempt to view the form. :banghead:

I've accomplished this before when everything was on the yard card alone but I found too many problems with putting the yard and road grades / times into one table, so I separated them.
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    5.4 KB · Views: 107
  • Capture2.PNG
    Capture2.PNG
    14.5 KB · Views: 115
  • Capture3.PNG
    Capture3.PNG
    9.4 KB · Views: 112
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:25
Joined
May 7, 2009
Messages
19,247
don't use expression as your controlsource for the textbox. Bind them to the field.
For those textbox that has sum() and calculation, add those field in the form and make the visible property to no.

You also need to add filter to the query if you are summarizing by student.
 

TMullins

Registered User.
Local time
Today, 15:25
Joined
Apr 21, 2018
Messages
19
Thank you for your assistance. As I've worked through this, I made the following revision(s), which I believe is what you mean by 'binding' a field.

I revised my queries so that they sum the hours and scores separately before bringing them into my form. To get my totals, I created a query using the aforementioned queries and grouped them by student and then calculated the sum inside of the query prior to bringing them into the form. It took several steps, but this is what I finally came out with.

Thank you for your help :D:D:D
 

Attachments

  • Capture4.PNG
    Capture4.PNG
    12.3 KB · Views: 97
  • Capture5.PNG
    Capture5.PNG
    24.4 KB · Views: 96
  • Capture6.PNG
    Capture6.PNG
    13.5 KB · Views: 88
  • Capture7.PNG
    Capture7.PNG
    12.1 KB · Views: 95
Last edited:

Steven_Bash

Registered User.
Local time
Today, 14:25
Joined
May 9, 2018
Messages
27
Maybe you can try DSum function. And if you have any zero or blank values in those fields use Nz() around your function
 

Users who are viewing this thread

Top Bottom