Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print a Conditional Second Page? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    I have a letter I

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

    Re: Print a Conditional Second Page? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Is the letter an Access report or are you inserting the text into Word?
    Charlotte

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

    Re: Print a Conditional Second Page? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    I assume this is an Access report. You can put a page break control brkNewPage and a text box bound to memDescription in the detail section, below the rest of the letter. Set the Can Grow property for the text box to Yes.

    In the On Format event of the detail section, show/hide controls according to the value of strLine1. You'll probably have to adapt the following, but it gives the basic idea:

    Private Sub Details_Format(Cancel As Integer, FormatCount As Integer)
    Dim HasePage2 As Boolean
    HasPage2 = (Me.strLine1 = "See Attached Violation List")

    Me.strLine2.Visible = Not HasPage2
    Me.strLine3.Visible = Not HasPage2

    Me.brkNewPage.Visible = HasPage2
    Me.memDescription.Visible = HasPage2
    End Sub

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print a Conditional Second Page? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Hi Hans

    I was in a jam time wise so I added the following to print the list with a second report if required. I was trying to get it done in one report. I will study your technique for future reference.

    Thanks, John


    Private Sub Report_Close()

    If (Forms(gloGetValue("ParentFormName")).strDescripti on1) = "See Attached Violation List" Then
    Dim strFilter As String
    Dim strDocName As String
    strDocName = "rpt_CR_Notice_First_Letter_List"
    strFilter = "[lngCRMasterID]=" & Forms(gloGetValue("ParentFormName")).lngCRMasterID
    DoCmd.OpenReport strDocName, acPreview, , strFilter
    End If

    End Sub

Posting Permissions

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