BUG: Report Preview with Form's Name Clears Object Reference

Last reviewed: April 25, 1997
Article ID: Q155463
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 5.0a

SYMPTOMS

Issuing a REPORT FORM PREVIEW command on a report that has the same file name as a form that is running causes the form to lose its object reference. If you attempt to reference the form object in code, this error message appears:

   Object not found

WORKAROUND

If you have a form called Customer and issue the following command, an object reference named Customer is created for the form:

   DO FORM Customer

Preview a report named Customer by issuing the following command:

   REPORT FORM Customer PREVIEW

The customer object now references the Report Preview window. When the Report Preview window is closed, the customer object is released. Work around this problem by giving your forms a different object reference than the reports with the same name. Do this by using the NAME clause in the DO FORM command. For example, to give the Customer Form an object reference of Custform, you would issue the following command:

   DO FORM Customer NAME Custform

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

  1. Create a report using the Customer.dbf file in the Vfp\Samples\Data folder.

  2. Save the report as Customer.

  3. Create a new form.

  4. Add two command buttons to the form.

  5. In the Click event of the first command button, add the following code:

          Customer.Caption = "Change Me"
    

  6. In the Click event of the second command button, add the following code:

          REPORT FORM Customer PREVIEW
    

  7. Save the form as Customer.

  8. Run the Customer form and click the first command button, then click the second command button.

  9. Close the Print Preview window and then click the first command button again.


KBCategory: kbprg kbother kbdisplay kbbuglist
KBSubcategory: FxprgGeneral vfoxwin buglist3.00 buglist3.00b buglist5.00
Additional reference words: 5.00 3.00 3.00b
Keywords : buglist3.00 buglist3.00b buglist5.00 FxprgGeneral vfpbug5.0a kbdisplay kbother kbprg kbbuglist
Version : 3.0 3.0b 5.0 5.0a
Platform : WINDOWS
Issue type : kbbug


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 25, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.