Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    173

    Unanswered: Mulitple Report Copies with Different Label Caption

    I need to print 3 copies of a report but for each copy I need to change the caption of a single label in the report header. I tried the following

    Private Sub Report_Activate()
    Dim intTemp As Integer
    For intTemp = 1 To 3
    Select Case intTemp
    Case 1
    Me.lblCopy.Caption = "Shippers Copy"
    Case 2
    Me.lblCopy.Caption = "Receive Copy"
    Case 3
    Me.lblCopy.Caption = "Consignee Copy"
    End Select
    DoCmd.PrintOut acPrintAll, , , acHigh, 1
    Next intTemp
    End Sub

    Only problem is this is tied to the activate event and prints 3 copies whenever this report gets the focus. Any ideas? TIA

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    The simplest method I know (and something I have used though admittedly it was because I had several "for your eyes only" fields as well as a public version of a report) is to:

    1)Change your label to a textbox and set it's source to TheHeaderField
    2)Change your recrodsource to:
    Code:
    SELECT "Shippers Copy" AS TheHeaderField, *
    FROM MyQuery
    UNION
    SELECT "Receive Copy", *
    FROM MyQuery
    UNION
    SELECT "Consignee Copy", *
    FROM MyQuery
    Alternatively, have your button run the report three times. Pass the string "Shippers Copy" as the opening arg first time, Receive the second time.... you get it yes?... Have the report read it's opening arguments on opening and write the text to the label.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Ah - report header - I saw Page Header. Two is probably better then.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Apr 2004
    Posts
    173
    I thought about building the report three times with the different caption, but I thought there had to be an eaiser way. The report uses a recordset to populate some fields and takes a while to run, so I have a concern about the time it takes to build the report. I will look at changing my design I guess to make things quicker. Thanks for the post though.

Posting Permissions

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