Results 1 to 9 of 9
  1. #1
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Report Problems (2000)

    <P ID="edit" class=small>(Edited by charlotte on 02-Sep-04 14:11. to activate post link)</P>Hi,
    I have a report that I posted a message about before (<post#=376574>post 376574</post#>). I would have bet my life that everything was working perfectly but now it does not seem to be. I've gone back and double checked everything from the post and I can't figure out what is wrong. Basically I limit the number of records that can print on page1 of a report. If the number is less than 6 then it should only print 1 page. If there are more than 6 records then the first 6 print on page 1 and the rest will print on page 2. The later works ok, but if there are less than 6 records, a page 2 still prints. Any thougts? I've attached a scaled version of the database. If you open the PurchaseRequestForm and choose between the 2 records click the print button to see examples.
    Thanks,
    Deb

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Problems (2000)

    In the on format from the detail section of report rptPurchaseRequestForm add the bold code :

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.srptPRPartsSubreportRest.Visible = _
    (DCount("*", "qryPRSubReport", "lngVendorID=" & Me.lngVendorID) > 6)
    Me.PageBreak212.Visible = Me.srptPRPartsSubreportRest.Visible
    End Sub
    Francois

  3. #3
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Problems (2000)

    Thanks Francois,
    It doesn't recognize PageBreak212. Where am I to put that? And could you explain what you did breifly so I can understand it.
    Thanks,
    Deb

  4. #4
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Problems (2000)

    I put the page break right before the second subreport but it didn't work. A page 2 is still showing when the records are less than 6.
    Thanks,
    Deb

  5. #5
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Problems (2000)

    I put the page break right before the second subreport but it didn't work. A page 2 is still showing when the records are less than 6.
    Thanks,
    Deb

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Problems (2000)

    Open report rptPurchaseRequestForm in design view, scroll down until you see the dots (see attachment). These are the pagebreak. Select them and open the property window and look what name the pagebreak have. In the db you send it was named PageBreak212. This is the name you should use in the code.
    A pagebreak force the report to go to the next page. If you set it invisible, it will not go to the next page. In your case, if the second subreport has to be visible, then the pagebreak should be visible also. If the subreport don't, the pagebreak should also be invisible.
    Francois

  7. #7
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Problems (2000)

    Francoise,
    This didn't help the situation. I still have a page 2 showing when I have less than 6 records. Any other ideas?
    Thanks,
    deb

  8. #8
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Problems (2000)

    In attachment the modified report. On my pc it give only one page.
    Francois

  9. #9
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Problems (2000)

    I figured out my problem. I had to use your page break code. Thank you very much for that. But I realized I was only checking one criteria (ie. VendorID) instead of both criteria VendorID and MachineID.
    Thanks,
    Deb

Posting Permissions

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