Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Sep 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    numbers missing on report on first open (A2K)

    I have a rather complex invoice report (3 subreports, multiple queries).
    When I run this report, the third page has blank values and thus no total. (Most values on the third page are fed from the calculated values on the first two pages.)

    When I go to design view and then run the report again, the values appear!

    While this is indeed mystical and wonderful, it is not convenient for my user to switch between views and run the report twice.

    Any ideas on why and how to fix it?

    The situation worsened when I added some VBA code to set field values on the main report - setting them to zero if
    'report.hasdata = false' and setting the fields to values calculated on the subreport if all was copascetic. That caused values on the second page to disappear. [img]/forums/images/smilies/sad.gif[/img]

    Any help would be appreciated.
    Suzanne

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    352
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: numbers missing on report on first open (A2K)

    I don't really know why, certainly without seeing your report and its underlying code. There is an issue with which events you put code in with reports. It sounds to me as though for some reason the dependent control are being calculated before all the data they are using has been calculated.

    I am not sure what you mean by first page, second page, third page. Are the controls which are not being correctly calculated in the detail section or the report footer? Controls within a section are not necessarily calculated in any particular order afaik.

    I would try to avoid having controls with values based on other calculated controls. It is better to put the whole of the formula for a control in that control's source (using domain aggregate functions) even though that may mean the database is queried twice for the same data.
    David Grugeon
    Brisbane Australia

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: numbers missing on report on first open (A2K)

    Sorry but you really have provided enough information for an answer. Do each of your subreports constitute a "page"? It sounds like you need a running value to carry forward but aren't getting it. Multiple queries baffles me. I can understand a query for each report or subreport, but is that what you meant? Some of your code may need to be moved to the Print event instead of the format event of whichever sections are involved.
    Charlotte

Posting Permissions

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