Results 1 to 3 of 3
  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

    How to Close Report? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have the following code in a form that opens a report in a design, then preview mode

    The report previews OK

    If I click the top right X the report closes and returns to the form, this is good

    If I press Esc Key while in report preview the report closes and goes to report design mode, this is not good

    Using the following what can I change so if I press Esc Key in preview mode the report closes and returns to the form just like clicking the X?

    Thanks, John

    <pre>DoCmd.OpenReport "rpt_ObjectMigrationWorksheet", acViewPreview
    Set rpt = Reports!rpt_ObjectMigrationWorksheet
    rpt!txtTitle = "List of Object Candidates for Migration"
    rpt!txtSubTitle = "(Included Dates: " & Me!txtStartDate & " to " & Me!txtEndDate & ")"
    DoCmd.OpenReport "rpt_ObjectMigrationWorksheet", acViewDesign
    DoCmd.OpenReport "rpt_ObjectMigrationWorksheet", acViewPreview
    </pre>


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

    Re: How to Close Report? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Why do you open the report in design view in the code? You can refer to the form in the control source of text boxes on the report, and/or you can pass a value from the form to the report in the OpenArgs argument of DoCmd.OpenReport.

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

    Re: How to Close Report? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    You’re right, its not my application, was asked to make some changes, just looking for quick solution.

    Thanks, John

Posting Permissions

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