Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Aug 2001
    Location
    Chewelah, Washington, USA
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing either or series of reports (Access 2002 SP1)

    I have five reports that preview when a command button (cmdPrintCountiesOpen) is clicked. We print and then fax the appropriate report to the respective county. Right now if there are no patients in the hospital for a county the report shows errors in the Totals areas, but we still have to send it. The county receiving the report knows that means there are no patients, but it would be much neater to have a report/fax that says

  2. #2
    New Lounger
    Join Date
    Sep 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing either or series of reports (Access 2002 SP1)

    Try this. In the reports NoData event add this code:

    Private Sub Report_NoData(Cancel As Integer)
    docmd.openreport "YourOtherReport"




    Then in the on open event of your "no data" report
    docmd.close acreport,"Your Original Report"
    End Sub

    HTH
    Eric

  3. #3
    Lounger
    Join Date
    Aug 2001
    Location
    Chewelah, Washington, USA
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing either or series of reports (Access 2002 SP1)

    Hi Eric,
    When I tried to run the reports I got an run-time Error '2585', This action can't be carried out while processing a form or report action and the de###### highlighted the "DoCmd.Close acReport, "rptCounty1Open". <img src=/S/help.gif border=0 alt=help width=23 height=15>

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Printing either or series of reports (Access 2002 SP1)

    What you could do is to setup a boolean after the Option Explicit in the coding of the report called blNoData.
    In the NoData event of the report set this boolean value to True.
    In the OnFormat event of the Totals areas test this boolean, and if true, set to visible a label that you have defined (as "No patients hospitalized" and invisible) in the Totals area, and set all other Totals controls to invisible.
    HTH
    Pat <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  5. #5
    Lounger
    Join Date
    Aug 2001
    Location
    Chewelah, Washington, USA
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing either or series of reports (Access 2002 SP1)

    Hi Pat and Eric,
    Thanks for all your help. I believe I understand Pat's directions, but it will be pushing my knowledge level. I'm going to work on it some today if it stays quiet. I do want to work on it before asking for more help. I'd like to get better and that's the only way that works for me. Will either call for help next week or let you know how it turned out.
    Sue <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>

  6. #6
    Lounger
    Join Date
    Aug 2001
    Location
    Chewelah, Washington, USA
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing either or series of reports (Access 2002 SP1)

    I did get Pat's suggestion to work this morning. I struggled with the blNoData As Boolean for a bit. Finally realized that I needed to show it as "Private blNoData As Boolean". Works great. Thanks for the help.

Posting Permissions

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