Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Checking Data and Removing SubReports On The Fly (Access 2000)

    I have a report that contains about 6 subreports. Each subreport is based on the same query, but just have a different filtered by clause. Is there a way to check before hand to see if any of those subreports will have any data, and if they do not, is there a way I can remove them from the main report. This report is used to an a copy of an invoice.

    Secondly, if a make an snapshot of an invoice and send it by email, what are the minimum requirements the users needs to view the snapshot?

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Checking Data and Removing SubReports On The Fly (Access 2000)

    If you set the CanShrink property of both the subreport and of the section it is in to Yes, subreports will vanish without leaving an empty space behind if they contain no data.

    The recipient of a report snapshot should have the snapshot viewer installed. This is a free download from Microsoft Snapshot Viewer Available in Download Center.

  3. #3
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Checking Data and Removing SubReports On The Fly (Access 2000)

    I have that, but each from has a label. Is there a way I could hide the label? I know I can set the visiblity to false, but how can I check if any records are going to go in that specific subreport?

    As a preference, what would you recommend is the best way to send an copy of the invoice by email. Snapshot or Richtext or any suggestions? [img]/forums/images/smilies/smile.gif[/img]

    Thanks

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Checking Data and Removing SubReports On The Fly (Access 2000)

    1. A (sub)report has a property HasData. You can use this in the On Format event of the section that contains the subreport to control the visibility of labels etc.

    Me.lblSomething.Visible = Me.sbrSubReport.Report.HasData

    2. Exporting a report to RTF doesn't yield attractive results in many cases - all graphics are lost, and layout is not really equivalent to that in Access. You get better results by creating the invoice as a Word document, for example by using mail merge. Sending a snapshot has the advantage that the recipient can't tamper with it, only view it, while sending an .rtf or .doc file has the advantage that a large majority of recipients will have Word installed, so they need no extra software.

  5. #5
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Checking Data and Removing SubReports On The Fly (Access 2000)

    OK, that works great. The only thing now is that since I have 6 subreports layed out, they all have small spaces between them. If I want to move, let say the 6th subreport up an inch, how can I do that? I tried to adjust the top postion of that report, but I get an error saying it is ready only.

    Thanks

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Checking Data and Removing SubReports On The Fly (Access 2000)

    You can either make the subreports "fit tightly", without space between them (but take care that they don't overlap, that will mess up the automatic shrinking), and provide the necessary space in the report header and footer of the subreports, or place text boxes with transparent borders between them, set the CanShrink property of those to Yes, and make them invisible in code whenever needed.

  7. #7
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Checking Data and Removing SubReports On The Fly (Access 2000)

    OK thanks Hans, I will change my label to transparent text boxes and line up the forms tightly. That is to bad that you cannot adjsut a subreports position by code.

    Thanks for the solution

  8. #8
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    268
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Checking Data and Removing SubReports On The Fly (Access 2000)

    The other option for sending output is to print to a pdf file, if you have adobe acrobat installed. Almost everyone has the acrobat reader - I found most of my users were very leery of installing the snapshot viewer, but had no qualms with acrobat (or already had it). I have no idea why they were so squeamish, but they were. The results on printing to acrobat were very acceptable.

Posting Permissions

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