Solved

Access 2010 report with a calculated field

Posted on 2012-04-06
6
459 Views
Last Modified: 2012-04-07
Microsoft Access 2010

I have a report.   Two of the fields are [Price] and [Quantity]

In the report,  I have added a textbox  whose name is "Total Price"

I would like to have that textbox  contain the value [Quantity] * [Price]  for each record as if it were stored data.

Can this be done?
0
Comment
Question by:peispud
  • 3
  • 3
6 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 37816746
Just add a text box and set the controlsource to:
=Quantity*Price
0
 

Author Comment

by:peispud
ID: 37816946
I tried this


Record_TotalCost.ControlSource = Me.[Quantity] * Me.WholeSale_Price_at_Invoice_Date

I put this code in my  Report_Load event.  When it runs, the code produces an error (see attached pic)

Me.[Quantity] does evaluate to                      2
Me.WholeSale_Price_at_Invoice_Date does  evaluate to          3
error.png
0
 
LVL 77

Expert Comment

by:peter57r
ID: 37817073
Try doing what I posted above
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:peispud
ID: 37817137
I did.   The name of my textbox was Record_TotalCost .  

Therefore,  unless I'm mistaken,  I've done just that.

Record_TotalCost.ControlSource = Me.[Quantity] * Me.WholeSale_Price_at_Invoice_Date
0
 
LVL 77

Expert Comment

by:peter57r
ID: 37817406
I didn't mention any code.
Just set the controlsource directly  (and don't use 'me.')
0
 

Author Closing Comment

by:peispud
ID: 37819773
You were right!

I didn't use the "equal" sign.  That makes all the difference.

Thanks
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Direct Mail software 4 44
Syntax Error in Query 7 31
Library not Registered 16 49
Access coding 2 13
This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now