ACC97: No Prompt for Parameter Value Exporting Form w/ OutputTo

Last reviewed: June 27, 1997
Article ID: Q170699
The information in this article applies to:
  • Microsoft Access 97

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

You are not prompted to enter a parameter value when you output a form to text if the form is bound to a query that contains an invalid form control reference on its Criteria row. However, the text file that is created does not contain any data.

CAUSE

This behavior occurs if you use implicit form control referencing in the query. For example:

   Forms![FormName]![ControlName]

RESOLUTION

To ensure that the text file that is created contains data, use explicit form control referencing in your query, or use the control's Value property. For example:

   Forms![FormName].[ControlName]

   -or-

   Forms![FormName]![Controlname].Value

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access 97. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

You can use the OutputTo action or method to output the data in a specified Microsoft Access database object (a datasheet, form, report, or module) to a file in Microsoft Excel 97 (*.xls), MS-DOS text (*.txt), or rich-text (*.rtf) format.

Steps to Reproduce Problem

  1. Open the sample database Northwind.mdb.

  2. Create a query based on the Customers Table. Add all the fields to the query.

  3. Add the following criteria to the CustomerID field and save the query as Query1:

           Forms![Form100]![Customer]
    

    Note that the query contains criteria which contains an invalid reference to a control called Customer.

  4. Create a form in Design view based on the Query1 query. Save the form as Form100.

  5. Create a module and type the following procedure in the module:

          Sub Test()
    
            DoCmd.OutputTo acOutputForm, "Form100", acFormatTXT, "C:\Junk.txt"
    
          End Sub
    
    

  6. Execute the procedure. Note that you are not prompted to enter a parameter value for the missing control's data, and a blank text file is created.


Keywords : kbusage OtpOthr
Version : 97
Platform : WINDOWS
Hardware : x86
Issue type : kbbug
Resolution Type : kbworkaround


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: June 27, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.