Microsoft KB Archive/248898

= ACC2000: Saving a Report to Different Format Reverts to First Instance of Report =

Article ID: 248898

Article Last Modified on 11/25/2002

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q248898



Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
If you have opened multiple instances of a report, you find that no matter which instance you try to export or e-mail, the earliest instance remaining open is always saved or sent. This happens no matter which format you choose for the export.



CAUSE
For these actions, Access only recognizes the earliest instance of the report.



RESOLUTION
To resolve this problem, obtain Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a).

To obtain SR-1/SR-1a, click the article number below to view the article in the Microsoft Knowledge Base:

245025 OFF2000: How to Obtain and Install Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a)

To temporarily work around this problem, do the following. If you want to send or save the second or later instance of a report, close the earlier instances. For example, if you have four instances of a report open, and you want to save the third one to a snapshot, close the first and second instances of the report. If you then also wanted to save the fourth instance of a report, first close the third instance.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was corrected in Microsoft Office 2000 SR-1/SR-1a.



MORE INFORMATION
CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

Steps to Reproduce Behavior
 Open the sample database Northind.mdb. In the Database window, click Reports under Objects, and then click Create report by using wizard. On the first Report Wizard page, click Table:Orders in the Tables/Queries list. In the Available Fields list, click OrderID, CustomerID, and EmployeeID and move these fields to the Selected Fields list. On the next page of the wizard, you do not need any grouping, so click the left arrow (<) in the center of the dialog box, so that the three fields appear as follows in the preview pane:

OrderID, CustomerID, EmployeeID

</li> Click Finish. A new Orders report appears in Print Preview.</li> On the View menu, click Design View.</li> On the View menu, click Properties.</li> Click the Data tab, and delete Orders from the RecordSource property.</li> Close the Properties dialog box.</li> On the View menu, click Code.</li>  For the Report_OnOpen event procedure, type the following code: Private Sub Report_Open(Cancel As Integer) Me.RecordSource = _ "Select * from Orders where EmployeeID = " _ & Forms!Test1.ActiveControl.Column(0) End Sub </li> Save the report as EmpOrders.</li>  Create the following form not based on any table or query: <pre class="fixed_text">  Form: Test1 -  Caption: TestForm

Combo box --  Name: RunReport1 Row Source Type: Table/Query Row Source: SELECT [Employees].[EmployeeID], [Employees].[LastName], [Employees].[FirstName] FROM [Employees] Bound Column: 1

Column Count: 3 Column Widths: 0";1";0"

Combo box --  Name: RunReport2 Row Source Type: Table/Query Row Source: SELECT [Employees].[EmployeeID], [Employees].[LastName], [Employees].[FirstName] FROM [Employees] Bound Column: 1

Column Count: 3 Column Widths: 0";1";0"                   </li> On the View menu, click Code.</li>  Type the following code:  Option Compare Database Dim rpt1 As Report Dim rpt2 As Report

Private Sub RunReport1_BeforeUpdate(Cancel As Integer) Set rpt1 = New Report_EmpOrders rpt1.Visible = True End Sub

Private Sub RunReport2_BeforeUpdate(Cancel As Integer) Set rpt2 = New Report_EmpOrders rpt2.Visible = True End Sub </li> Save the code, close the module, and return to the form.</li> Run the form, and then in the RunReport1 combo box list, click Peacock. The first instance of the report appears. You see all of the orders handled by Peacock. Do not close the report.</li> Return to the form, and then in the RunReport2 combo box list, click Fuller. The second instance of the report appears. You see all of the orders handled by Fuller.</li> With the second instance of the report active, click Export on the File menu.</li> <li>In the Save as type box, click Snapshot Format. Click Save.</li></ol>

Note that in the Snapshot Viewer you see the data from the first report. You see Peacock instead of Fuller.

Additional query words: pra excel rich text format html xls rtf htm txt snp

Keywords: kbbug KB248898

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.