Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2002
    Posts
    3

    Question Unanswered: Referencing Caption in Access Reports

    Hi there

    I have a database with four reports designed. The user is prompted for a date range, which will change the queries that the reports are based on for the selected dates. It will then output the reports to pdf format.

    I want to change a caption on each report before it is exported so it will display the chosen dates, (e.g. "Update Report 04/01/2004 to 04/30/2004") however I can't seem to figure out how to set the caption properties in a closed report.

    Could someone please help me with the syntax I need to acheive this... i.e. how to set a report object, and access a caption property using vba without having to display the reports.

    Thanks.

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Do that in the Report_Open(Cancel As Integer) event of the report

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Arrow

    Example

    lbl_BirtdayBetween.Caption = Forms("F_Birthday").txt_BirthdayFrom & " and " & Forms("F_Birthday").txt_BirthdayTo

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Oh, and don't be dismayed at the fact that when you type in "caption" that that property does not appear as part of the autocomplete ... It's still available and will work.

  5. #5
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Yes, that is good point, the caption property, is still available.

  6. #6
    Join Date
    Oct 2002
    Posts
    3

    How to access caption for CLOSED reports

    Thanks for the answers, however I want to access and change a label in a ClOSED report. Can I declare a report object (e.g. dim rCompany as Report), set it to a specific report in the collection and then reference/change a label on the report while it is closed? If so what is the syntax.

    Thanks.

Posting Permissions

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