Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / December 2005

Tip: Looking for answers? Try searching our database.

Trouble with percentage on report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin - 08 Dec 2005 17:45 GMT
I'm trying to display an estimated gross profit percentage on a report, but I
keep getting syntax error messages and have tried a variety of expressions.  
I'm wondering if anyone could offer some help in creating the correct
expression.

I have two text boxes:
-  "CostTotal" , which is the sum of another field in the detail section of
the report called LineTotalCost. The expression in this is
=Sum([LineTotalCost]).
-  "ContractTotal" , which is the sum of another field in the detail section
of the report called SellPrice, plus a manually entered sales tax amount. The
expression in this is =Sum([SellPrice])+[SalesTaxAmount].
Both of these work perfectly.

The result I'm looking for would take the difference between CostTotal and
ContractTotal, and calculate what percentage of ContractTotal that is.  For
example:  If CostTotal is $40,000, and ContractTotal is $50,000, the gross
profit percentage would calculate to be 20%.  I have tried numerous
configurations and an equal amount of error messages have been the result.  
Seems simple, but I just cant get it to work.  It didn't seem to acknowledge
the "Name" of each text box either (in some of my attempts).

All suggestions are greatly appreciated!
Marshall Barton - 08 Dec 2005 20:35 GMT
>I'm trying to display an estimated gross profit percentage on a report, but I
>keep getting syntax error messages and have tried a variety of expressions.  
[quoted text clipped - 17 lines]
>Seems simple, but I just cant get it to work.  It didn't seem to acknowledge
>the "Name" of each text box either (in some of my attempts).

A text box with the expression:
    =1 - CostTotal / ContractTotal
should provide the percentage you want.

I can imagine that giving various jubds of errors when you
speel a name wrong or use the expression in an inappropriate
place, but I can't see how it could give you a syntax error.

Signature

Marsh
MVP [MS Access]

Kevin - 08 Dec 2005 22:09 GMT
As I said, it seems like it should be simple.  This works great and returns
the results I was looking for.  Sometimes I try to make things harder than
they need to be.  Thanks for the help!
Kevin

> A text box with the expression:
>     =1 - CostTotal / ContractTotal
[quoted text clipped - 3 lines]
> speel a name wrong or use the expression in an inappropriate
> place, but I can't see how it could give you a syntax error.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.