Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2005
    Posts
    2

    Question Unanswered: Calculation problems

    This may sound daft but i'm using the following data: =sum([media_in]-[media_out])
    This produces the requested result, but for each entry the field update ok but the previous data has been replaced. I doing test data entering 20 records into one cust_file which requires a printout of the date entered and media_remaining. All I have is a null on the printout and in the table. Data is entered into the form via a 162 item switchboard, also via html access page.
    The table has nothing in it under the media_remaining. What am I doing Wrong?

    help
    Last edited by starfire01; 02-11-05 at 05:46.

  2. #2
    Join Date
    Feb 2005
    Location
    England.
    Posts
    232
    This is a query I'm assuming?

    If so, don't bother with the sum. Your field should be...

    {Field Name}: [media_in]-[media_out]

    Hope this helps.

  3. #3
    Join Date
    Feb 2005
    Posts
    2

    Calculation Problems

    Thanks but the calculation is not done in MS Access Query but in the sorce of the form. The figure is working correctly but the first item in the form does not have an answer written to the table file. Therefore the reports printout is missing the calculations.

    Regards

  4. #4
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Is your text box that holds the result bound to the table?

  5. #5
    Join Date
    Jul 2004
    Location
    Southampton, UK
    Posts
    368
    Hi

    What is the purpose of your calculation ? Is it to give the difference on a record by record basis ? Or is it to give the overall difference of all records i.e. the total remaining ?

    Either way, you should not need to store the result of such calculations into your table. This is bad practice anyway. I suspect this is what DJN is also getting at. If there is a formula in a field then it's unlikely to be bound to your table.

    The principle is, wherever you want to see the result, you must create the calculation. So you will have a calculation done on the form (which works). And you will have a calculation built into your report.

    Chris

  6. #6
    Join Date
    Apr 2003
    Posts
    36

    How to do calculations across rows?

    If there is a report or sub-report in which each row shows a test score result, and I'd like to have a column that shows the net gain or loss from test score to test score, what is the best way to do that? There is only a single field in the detail section that comes from the query. But I'd like to have a field next to it that shows the + or - from the row above (if there's more than one row). Is there a way to do this in Access?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •