Output Query Results to a Text File

W

WileyW

This is my first macro, so be sensitive! I am attempting to create a macro
that opens and runs a query, exporting the results to a text file. It runs
fine until the export step where I get the global message "Access can't save
the output data to the file you've selected. I've been through all of the
help files the seem to pertain, but nothing is registering. Here is the
macro:

Action
OpenQuery Extract Teachers, Datasheet, Read Only
OutputTo Query,,,c:\Eduphoria Teachers, Yes,,1,Print
Quit Save All
 
J

Jeff Boyce

If the error message is to be believed, Access (or Windows) is having a
problem with a file you've named "C:\Eduphoria Teachers".

This could be because no such file exists, or there's no file extension
(e.g., ".txt"), or because there's a space in the filename, or ...

If this were mine, I'd try including an extension and losing the space.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top