Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2004
    Posts
    22

    Question Unanswered: report caption from form control?

    I have a form with a Command Button. The button has an On Click event procedure that opens a form and prints it. Two questions:

    1) Is it possible to include code that will select a certain printer for the output? We often use this report in PDF format to e-mail to other offices and it would be nice if I could find a way to designate the printer as acrobat distiller when the button is clicked.

    2) Is it possible to include code that changes the caption of the report to include text from a control on the form? The reports are cost summaries of projects. The form selects the project and the report prints the results. It would be nice if I could find a way to code it so that the project number, which is one of the controls on the form, is included in the report's caption. When the report is printed to acrobat distiller, the caption is used as the default filename.

    Thanks in advance for any suggestions.

    Craig
    rockjock

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    changing the caption fo the report can be done. If you only call this report from the form then, suggest you put some code in the reports onopen / on load event
    eg me.caption=forms!frmmyform!ctlmycontrol.caption

    the precise wording may be different (it could be report.title/me.title)
    but this should point you in the right area.

    As to specifying printers, I'll let someone else comment on that

  3. #3
    Join Date
    Nov 2004
    Posts
    22

    Smile

    Thanks for the idea! I was able to change the reports caption by using the following On Open command:

    Me.Caption = [Forms]![frmPCSummary]![ProjectNumber] & "HrsByActivity"

    This put both the project number (from a combo box on my form) and the text "HrsByActivity" as my report's caption. Therefor, when I save the Adobe PDF file generated by printing this report, the filename is [ProjectNumber]HrsByActivity (e.g. 04E-7005HrsByActivity).

    Now if only I could find a way to have access merge pdf documents. I generate 5 separate reports for each project, and a single PDF file would be a big bonus! Any ideas?

    Thanks again,

    Craig
    rockjock
    Last edited by rockjock; 11-30-04 at 19:58.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    option 1) would be trofold those reports into one new report. If you need to keep the option of generating individual reports aswell then you may need to consider cloning the report (nasty as it then means you, or you successor, have to apply any changes in one report to another report). If not then create a new report, insert the pre-exisiting reports as sub reports, with a form feed between each sub-report. You will probably need to set each sub reports "cangrow" property to true.

    Not certain if this will work, I'm still brain dead from last nights session

  5. #5
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146
    He used the word "separate" so I'm assuming each report needs to be on an individual page. There would almost have to be a page break (Force New Page) after each subreport. If not, you'd get a grouping effect...
    Last edited by smacdonaldnc; 12-01-04 at 04:38.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    oldtimers like me still refer to formfeed. you youngsters can call it a page break if you like but to me its still a formfeed. (old habits from pre windows software die hard)

  7. #7
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146
    **I had posted the same response provided by healdem... just with some different terminology. I beleive that healdem's explanation should do the trick.
    Last edited by smacdonaldnc; 12-01-04 at 04:55.

  8. #8
    Join Date
    Nov 2004
    Posts
    22

    headers for subreports

    You two have sure been helpful, thank you. I have now created a new report that consists of all of the reports I needed combined as subreports. This seems to work beautifully, with a few glitches. I have been able to get the pages to break where I want them to, hurah for that. However, some of my reports have multiple pages and I can't seem to find a way to have any of the headers repeat on subsequent pages. If I put the header info in the report or page header of the subform, it doesn't show up at all. If I put it on a group header in the subform, it shows up on the first page but not on any of the pages that follow. Any idea how I can have a unique header for each of these subreports that will repeat on every page that the subreport is on?

    Again, thank you for your help. You have saved my headache for another day.

    Cheers,

    Craig
    rockjock

Posting Permissions

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