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

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » How to Close Report? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Author
    Topic
    #447073

    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

    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
    
    Viewing 0 reply threads
    Author
    Replies
    • #1088790

      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.

      • #1088797

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

        Thanks, John

    Viewing 0 reply threads
    Reply To: How to Close Report? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: