Results 1 to 6 of 6
  1. #1
    Jerry Call is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    May 2020
    Location
    Champaign, Illinois
    Posts
    85

    Printing only rows in which a specific field is greater than 0

    I have a CalcValue column in a report. Here's its defining code:
    =Round([FullUnitCost]/[NoInFull]*[CumTally],3

    This code produces the results I want, rounding off to 3 decimal places.

    However, I would like to add one additional detail:
    If the resulting number is not greater than zero,
    I don't want that row to print on the report.



    Is this the correct place to make that happen?
    If so, how? If not, what is the best way to obtain this result.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    you can't suppress records in a report based on calculations performed in the report - or at least not easily. Once the report is loaded, that's it. There may be a report event (e.g. detail format) that would work, but it would be clumsy and could end up running for every record or group header in the report.
    IMO you need to move that calculation to your query and bind the report control to that query field. Criteria for the calculated field would be >0.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Jerry Call is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    May 2020
    Location
    Champaign, Illinois
    Posts
    85
    Aha! Put a WHERE clause in the query. Works like a charm. Thanks!

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    You're welcome. Please mark your thread as solved (Thread Tools at top).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Jerry Call is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    May 2020
    Location
    Champaign, Illinois
    Posts
    85
    I see your mark as solved option at the top, but I'm darned if I can get to the specific option it lists.
    Just for the heck of it, please tell me how to get to that path!

    But as for this thread, yes, you can mark it solved (since I seem to be unable to do so).

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Seems I was able to mark it as solved but that surprises me. I thought that option was only available to the creator of the thread, which makes sense. Maybe it's one for the moderators.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 15
    Last Post: 02-09-2018, 08:53 PM
  2. Replies: 3
    Last Post: 07-28-2017, 04:03 PM
  3. Replies: 1
    Last Post: 01-05-2017, 05:14 PM
  4. Replies: 2
    Last Post: 06-01-2015, 01:21 PM
  5. Replies: 7
    Last Post: 12-11-2009, 01:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums