Export Parameter Query to Text

Brian100x

New member
Local time
Today, 03:42
Joined
Jun 20, 2001
Messages
8
I have a query that I need to export to a .txt file. The query uses three fields from a form to identify which records to export. When I try to export the query to the .txt file I get a "Too few parameters. Expected 3". I know this is a result of the information from the form, when I hard code the information in place of the form text box reference, the query exports just fine.

Defining the parameters in the query does not solve the problem. I checked the Microsoft home page and the solution that they provide has two problems. First when the query is saved and reopened it changes the SQL so it makes a new table in the database rather then a new file. Second it always saves it as a comma delemimeted file. I need it saved as a tab delimited file.

Does anyone know how to solve this it has been drifing me nutts all day.

Brian
 
I tried defining the parametes in the query and that did not solve the problem. If I export the query to a Excel file I do not have an issue. This seems to be an Access limitation, Microsoft sugests using a query like this (in the Northwind.mdb sample)

SELECT * INTO [Text;FMT=Delimted;HDR=Yes;DATABASE=C:\;].[Employees#txt] FROM Employees WHERE [EmployeeID] = [Enter an EmployeeID];

the Micorsoft page for this is http://support.microsoft.com/search/preview.aspx?scid=kb;en-us;Q269671

This works except for the two issues that I mentioned in the previous post. I do have an Export template for this file, but I do not know how to integrate that into the SQL statement?
 

Users who are viewing this thread

Back
Top Bottom