Solved

Access 2010 report with a calculated field

Posted on 2012-04-06
6
475 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

840 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