×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Report Based on Calculations

Report Based on Calculations

Report Based on Calculations

(OP)
I need to generate a quarterly report (user input date parameters) that contains about 60 different calculations.  I have been writing a procedure with a series of nested Case statements to produce the calculations.  I thought they were too difficult to do in a query.  How do I tie these calculations to a report?  (I'm using Access 2000.)  I only want the calculations on the report with some labels and other text, nothing else from the database.  I'm new at Access and any suggestions would be greatly appreciated.  Thanks!

RE: Report Based on Calculations

Declare the variables of the calculations in a PUBLIC module as GLOBAL.

e.g.
    Global MyCalVar1 as Single
    Global MyCalVar2 as Integer


Execute the routine which does the calculations in the open event of the report.

Reference the global variables in hte report controls record source.

e.g.

MyRptTxt1.ControlSource: MyCalCal1

'__________________________________________________
A reasonable alternative would be to place each of the calculations in seperate mprocedures (Functions) in the report.  Set the control source for each field to the appropiate procedure.  Of course, you will still need to make the source variable available to the report module.



MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over

RE: Report Based on Calculations

(OP)
I've tried using the global variables as suggested.  However, it's telling me that I can only set the record source property to a table or query.  Any thoughts?

RE: Report Based on Calculations

You need to set the CONTROL Source, for each INDIVIDUAL control.  Leave the Record Source empty.

The control source may be an expression which is NOT a field in the recordsource.

MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close