Help needed: Updating subtotal only in the last record of each item in Access form (1 Viewer)

shobhanauto

New member
Local time
Tomorrow, 02:28
Joined
Dec 17, 2023
Messages
23
Hi everyone,


I am working on a Microsoft Access project where I add multiple records for items in a subform. Each record has a Box_Weight field, and I want to calculate the subtotal (sum of Box_Weight) for each item. However, I want to show this subtotal only in the last record of each item, not in every row.


I upload my project file here so that someone can help me directly. If anyone is willing to assist, please let me know.
 

Attachments

  • RackingList.accdb
    RackingList.accdb
    6 MB · Views: 15
  • download (1).png
    download (1).png
    2.8 KB · Views: 11
I cannot see your image. But you want the sum of "Box_Weight" for the packing list to show on the row of the last item.
That seems bizarre. Why would anyone look there instead of the Main form? You could do a running sum and that could make a little more sense but a single column in the last item with the total weight for the packing list does not make a logical display. You could put it in the footer if you wanted. But again it is for the whole packing list and does not seem sensical what you are asking.
 
here is image i want like this
 

Attachments

  • WhatsApp Image 2025-06-20 at 23.01.06_a0df527b.jpg
    WhatsApp Image 2025-06-20 at 23.01.06_a0df527b.jpg
    65.8 KB · Views: 23
That picture seems to show the opposite of what you initially posted? :(

Work out a way to set the font to white in CF. Probably Dmax() on ID and whatever groups them together.
 
I’ve attached an image to help explain the issue with the TOTAL_NT_WT calculation
Yes, and the totals appear to be in the FIRST record?
Or I am missing something.
How are you meant to get totals for records you have not reached yet?

Perhaps use the recordsetclone and set that control in VBA?
 
Actually sir
I don't understand English very well
What I’m trying to do is this:


In my packing list, sometimes there are 2 items, sometimes 5 or more.
I want to sum the NET WEIGHT (Box_Weight) of all records for each item,
and then set that total as TOTAL_NT_WT, but only in the last row of that item.


Can you please help me with this?
 
Not possible without extra queries and a lot of work.

Do not confuse forms with reports.
How can I create extra queries?
If I have a packing list with 1000 items, how can I create a separate query for each item?


Because in one box, there may be 4–5 different items.
So I want to handle each item individually using separate queries or filters.


Can you please guide me on how to do this?
 
Can you please guide me on how to do this?
Not with a form.

For starters, it sounds like you need to redesign your tables. You need an intermediate table for a case. That will give you an easier way to calculate the sum within a case.

You are most likely talking about printing the sum on a label. That is a report and that is a far better place to do this. Is that what you need the sum for?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom