Exporting a Query Result

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query with a parameter that works fine when I display it. It
prompts me properly and returns the proper result. The query is:

SELECT ITEMS.SHORTNAME FROM ITEMS WHERE (((ITEMS.ID)=[Nbr]));

My problem is that I want to export the result to a CSV file. When I
highlight the query in the Database windowl and choose from the Menu barprompted for a value, I get the following error: Too few parameters.
Expected 1.

Can someone confirm this behavior and hopefully offer a solution to this
problem.
 
I use the following 'work around' - Choose Tools - Office Links - Analyze it
with Microsoft Excel. It will prompt you to enter your parameter and open
the results in Excel. From Excel go to save as and change the file type to
csv there. It's an extra step, but it works!
I'll be watching to see if anyone comes up with a better idea!

genojoe said:
I have a query with a parameter that works fine when I display it. It
prompts me properly and returns the proper result. The query is:

SELECT ITEMS.SHORTNAME FROM ITEMS WHERE (((ITEMS.ID)=[Nbr]));

My problem is that I want to export the result to a CSV file. When I
highlight the query in the Database windowl and choose from the Menu barprompted for a value, I get the following error: Too few parameters.
Expected 1.

Can someone confirm this behavior and hopefully offer a solution to this
problem.
 
Open your query in design view. Right Click anywhere in the query window
where your Items table is at. In the dialog that appears, click on
Parameters. In the parameters form, enter Nbr under parameter and use the
drop down list in the Data Type column to set it to Long Integer. Close
everything. When you run your query you will no longer get the error
message.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com



genojoe said:
I have a query with a parameter that works fine when I display it. It
prompts me properly and returns the proper result. The query is:

SELECT ITEMS.SHORTNAME FROM ITEMS WHERE (((ITEMS.ID)=[Nbr]));

My problem is that I want to export the result to a CSV file. When I
highlight the query in the Database windowl and choose from the Menu bar being
prompted for a value, I get the following error: Too few parameters.
Expected 1.

Can someone confirm this behavior and hopefully offer a solution to this
problem.
 
When I use this fix, I still get the same error message. My query, however,
does change to become:

PARAMETERS Nbr Long;
SELECT ITEMS.SHORTNAME
FROM ITEMS
WHERE (((ITEMS.ID)=[Nbr]));
 
Back
Top