Microsoft KB Archive/210607

= ACC2000: No Prompt for Parameter Value Exporting Form with OutputTo =

Article ID: 210607

Article Last Modified on 7/15/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q210607



This article applies only to a Microsoft Access database (.mdb).

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



SYMPTOMS
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 in 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 Value property of the control. For example:


 * Forms![FormName].[ControlName]

-or-


 * Forms![FormName]![Controlname].Value



STATUS
Microsoft has confirmed that this is a problem in Microsoft Access.



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 (*.xls), MS-DOS text (*.txt), or rich-text (*.rtf) format.

Steps to Reproduce Problem
 Open the sample database Northwind.mdb. Create a query based on the Customers Table. Add all the fields to the query. Add the following criteria to the CustomerID field and save the query as Query1:

Forms![Form100]![Customer]

Note that the query contains criteria that contains an invalid reference to a control called Customer. Create a form in Design view based on the Query1 query. Save the form as Form100.  Create a module and type the following procedure in the module: Sub Test

DoCmd.OutputTo acOutputForm, "Form100", acFormatTXT, "C:\Junk.txt"

End Sub </li> Run the procedure. Note that you are not prompted to enter a parameter value for the missing control's data and that a blank text file is created.</li></ol>

Additional query words: pra

Keywords: kbbug kbpending KB210607

-

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

© Microsoft Corporation. All rights reserved.