Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Posts
    304
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding extra 'lines' at end of Access report (Access 2003)

    (Background) I am working on a report that is a sign-in sheet for a seminar we are having. The report pulls registrant information like FName, LName, Company, etc. and lists them, sorted by last name. I've (manually) drawn lines around each of the fields in the details section so that the resulting report looks very much like a table. I'm having no problem getting the report to return the information that it should, or look the way it should. (Problem) The problem lies in that inevitably every year people show up for the seminar who failed to register, and we'd like a way to write them in. Someone suggested blank lines at the end of the report, so I added a Report Footer section to the report and I was wondering if there is any way for me to draw one series of blank boxes/lines and for Access to know to repeat that until it gets to the end of the page? Or maybe even repeat it to the end of the page AND give us a full page of blank lines for more unregistered applicants.

    Let me know if there's anyway to do this, or if I'm attempting the impossible (or ridiculous).

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

    Re: Adding extra 'lines' at end of Access report (Access 2003)

    I have attached a sample database. The detail section in the report contains two extra text boxes with Visible set to False. txtCount simply counts the number of records, its control source is =Count(*). txtCounter is the current record number; its control source is =1 and its Running Sum property has been set to Over All.
    There is some code behind the report to print extra dummy records after the last real record:

    ' You'll have to determine the correct value by experimenting
    Private Const MaxTop = 14900

    Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Static blnEnd As Boolean
    Static lngTop As Long
    If blnEnd Then
    ' We're past the last record
    If Me.Top > lngTop And Me.Top < MaxTop Then
    ' Still on the same page
    Me.strProductName.Visible = False
    Me.NextRecord = False
    End If
    ElseIf Me.txtCounter = Me.txtCount Then
    ' We're at the last record
    blnEnd = True
    lngTop = Me.Top
    Me.NextRecord = False
    End If
    End Sub

    The constant 14900 is roughly the distance of the top of the last record on a page from the top of the page in twips (1440 twips = 1 inch), you'll have to fiddle with it to get it right.

    The idea for this demo is inspired by MSKB article ACC2000: How to Print a Constant Number of Lines Per Group.

  3. #3
    3 Star Lounger
    Join Date
    Apr 2001
    Posts
    304
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding extra 'lines' at end of Access report (Access 2003)

    Hans - where would you put this code in the report?

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

    Re: Adding extra 'lines' at end of Access report (Access 2003)

    The declaration of the constant would go at the top of the report's code module. The rest is the event procedure for the On Print event of the Detail section. If you download the zip file I attached to my previous reply, you can view the report and the code.

Posting Permissions

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