Use of Calculated values in a report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • royals
    New Member
    • Apr 2009
    • 5

    Use of Calculated values in a report

    Hello Access gurus,

    I am a self-taught Access “developer ” and have a ton to learn so please allow me to sound stupid. I am using 2003 on a XP platform.

    I manage properties for an organization. At times it is necessary to pay an individual to stay in a house so that it isn’t vacant for an extended period of time. The organization pays the entire utility cost but deducts the individual’s usage cost.

    In other words, they receive ‘Pay’-(‘bill1 + bill2 + bill3…’ - ‘basic cost1’ + ‘basic cost2’ + ‘basic cost3…’).
    I have a subform where I input each of the monthly basic costs and bills. I sum the basic costs column and the bills column on the footer, and then on the form, I calculate Pay – (sum of bills – sum of basic cost) = remuneration. This is working fine.

    My problem is with the ‘monthly payment request report’ I want to print. Since the values I want to print are calculated form values and only exist when the form is open for that particular record, I don’t know how to put them on the report. Is there a way to write those calculated values to a field in the record so that I can produce a report? I’m sure it can be done but need an example to go by. Or, if I am going about this totally wrong, I’m open to a better way.

    Thanks in advance,
    Ed
    Last edited by debasisdas; Apr 13 '09, 07:59 AM. Reason: question moved to access forum.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32656

    #2
    Generally this is done in the underlying query (that the form and reports can be built on). Without knowing the layout of your data better, I can add no more than that basic hint.

    This is, however, an important point to remember generally when working with such objects. Arithmetic (especially complicated stuff) is better done in the underlying query where possible.

    Welcome to Bytes!

    Comment

    • royals
      New Member
      • Apr 2009
      • 5

      #3
      I thought that might be your responce. I've tried to do it in the underling query but am having some problems. The tabel that I am query has bill cost and basic cost for all properties. In most cases there are several record for each property. When I use DSum it totals everything. I want a seperate total for properties a, b, c, etc. Each property has a unique id. How can I set a varable to work with the criterion part of the DSum function?

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32656

        #4
        I still can't help (See comment in earlier post) unless you describe how your data is held, how you're querying it at the moment and what you want to achieve.

        Comment

        • royals
          New Member
          • Apr 2009
          • 5

          #5
          Fixed my problems

          Bytes is a terrific resource. I have solved several problems already just by viewing other threads.
          Thanks and congratulations for the site.

          Ed

          I do have a question though. I can add to this thread but I can't seem to create a new one. I read the problems with adding post entry, maybe my account needs to be reactivated. How do I do that? What am I doing wrong?

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32656

            #6
            My guess is that you are in the parent folder. Look near the top for a link to Answers.

            If this fails, then please follow the instructions found in HELP! My ACCOUNT is DISABLED!.

            Comment

            Working...