Sum in Split Form

Kamlesh Jain
Kamlesh Jain used Ask the Experts™
on
I had this question after viewing Sum column, split form.

Dear Team,
I am facing similar problem. Split form is not showing the sum and some times, it shows incorrectly. The column values are arrived using a query, jsut to clarify.
Facing similar problem in other form as well, which is similar.
Screen Shot is attached.
Thanks
2017-02-28_LI.jpg
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ryan ChongSoftware Team Lead

Commented:
Split form is not showing the sum and some times, it shows incorrectly.
you may check the data type of that field as well as the values within that field.
Kamlesh JainManager

Author

Commented:
data types is number and values are ok i mean numerals only.
Ryan ChongSoftware Team Lead

Commented:
based on your image file in your question, can you go to the column: Sold and see what dropdown options available there?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Kamlesh JainManager

Author

Commented:
Yes. Normal options like Count, Max, Minx, Std Deviation etc are available
2017-03-08--1-.png
Ryan ChongSoftware Team Lead

Commented:
try select "Sum" and see if the value looks abnormal
Kamlesh JainManager

Author

Commented:
tried Sum but not working... However, other functions like Count is working fine !!

Simlar to this form, i have another form but it shows vague results. Screen shot is attached, FYR.
2017-03-08--2-_LI.jpg
Ryan ChongSoftware Team Lead

Commented:
are both "Lifted Qty" and "Un Lifted Qty" derived/calculated fields? can we make sure these fields returning numeric values?

possible to upload a sample (without real data) here for troubleshooting?
Kamlesh JainManager

Author

Commented:
Sorry sir. I am not allowed to upload it on public platform. But i can send it through email, provided EE portal permissions this.
Kamlesh JainManager

Author

Commented:
These fields "Lifted qty" and Un lifted qty are derrived by query.

Two Tables are there : tblSale and tblLifting


SELECT Val((select NZ(sum(tbllifting.[Lift_qty]),0) from tbllifting where tbllifting.[Sale_BN] = tblsale.[Sale_BN])) AS Lifted, [Sale_Qty]-Val((select NZ(sum(tbllifting.[Lift_qty]),0) from tbllifting where tbllifting.[Sale_BN] = tblsale.[Sale_BN])) AS Unlifted, *
FROM tblsale
ORDER BY tblsale.Deal_Date DESC;

  Thanks for your efforts.
Ryan ChongSoftware Team Lead
Commented:
you may try:

SELECT Val((select sum(tbllifting.[Lift_qty]) from tbllifting where tbllifting.[Sale_BN] = tblsale.[Sale_BN])) AS Lifted, [Sale_Qty]-Val((select sum(tbllifting.[Lift_qty]) from tbllifting where tbllifting.[Sale_BN] = tblsale.[Sale_BN])) AS Unlifted, *
FROM tblsale
ORDER BY tblsale.Deal_Date DESC;

Open in new window


or

SELECT (select sum(tbllifting.[Lift_qty]) from tbllifting where tbllifting.[Sale_BN] = tblsale.[Sale_BN]) AS Lifted, [Sale_Qty]-(select sum(tbllifting.[Lift_qty]) from tbllifting where tbllifting.[Sale_BN] = tblsale.[Sale_BN]) AS Unlifted, *
FROM tblsale
ORDER BY tblsale.Deal_Date DESC;

Open in new window

Kamlesh JainManager

Author

Commented:
Thanks. Tried both querries but problem is not resolved. .. will compiling the database will make difference ?

I am ok with the outcome of the data components like lifted Qty and Un lifted qty. But problem is in the sum which is inbuilt feature of split database. Can we do it manually by adding three text boxes at the bottom or top of the data sheet part ?
Ryan ChongSoftware Team Lead

Commented:
will compiling the database will make difference ?
probably the answer is No.

I am ok with the outcome of the data components like lifted Qty and Un lifted qty. But problem is in the sum which is inbuilt feature of split database. Can we do it manually by adding three text boxes at the bottom or top of the data sheet part ?
I'm kinda don't get what you mean here. can you elaborate further?
Kamlesh JainManager

Author

Commented:
I mean formula part or data outcome of the quarries are ok. I am facing problem in Sum only. So can I add three text boxes at top or bottom, and put totals of the filtered record source there ?
Distinguished Expert 2017

Commented:
I occasionally have a problem with the "totals" row.  It may have to do with how large the recordset is.  If you need to ensure that the row is always present and accurate, add controls to the footer of the datasheet form and copy them to unbound controls on the main form.

You can either do this with code in the AfterUpdate event of the subform or by using calculated columns.
Kamlesh JainManager

Author

Commented:
Thanks Mr Part for your kind advise. I would like to say :

1. Recordsets in my datasheet are barely 300 records.
2. i added footer to the control of form (Its split form and Footer component doesnt show at all in Form View. :(
3. I am not using Subform as its split form in which Form Part is in Form Header and Data sheet as Details, at Bottom,
4. FYI, screen shots of both forms are  attached.

Could you help please with Totals in Text Box controls ?
Thanks in advance.
2017-03-08--1-.png
2017-03-08--2-_LI.jpg
Distinguished Expert 2017
Commented:
The totals feature is attractive on the surface but I have also found it to be unreliable  The problem you are experiencing might be caused because you are using a split form.  That form stile is easy to create the old-fashioned way so you don't need to use it either especially since it is also prone to strange errors.  

What you are seeing is a bug.  None of us can fix this type of bug.  That is why I offered an alternative.  If you want to contact Microsoft, they might fix the problem for you.  Be prepared to front them around $500.  They will look at the problem and offer solutions.  If the problem is caused by a bug, they will refund your fee.  None of the free help will look at your code or even be competent in Access.  The free help is geared more to the other Office products and typical user problems.  They can't help with programming problems.
Kamlesh JainManager

Author

Commented:
Thanks team. Now I will try to convert into subform or continuous form. Thanks for your efforts and time devoted.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial