Setting OutputTo path in VBA for Access 2003

C

Charles

I'm using the Do.Cmd OutputTo function in VBA for Access 2003. I am able to
get all the variables I've set (as opposed to just using the defaults) to
function normally except for setting the path where the file is output to.
I've placed the database on a network drive in a folder and I want the
"OuputTo" file to save to the same driver but a different folder. Example:
The file is located something like this G:\MyFolder\MyDatabase. I want the
file to output to G:\MyReports\"MyOutputTo.rtf" If I just use this
G:"MyOutputTo.rtf" the file ends up on the network drive in the root but I
want it to go to a folder I've set up for it. I can only assume that Access
2003 is having a problem with the "\" character but I don't know how to get
around it. Any help?
 
C

Charles

I guess I didn't put that in the original post. I'm sorry. I've actually
already tried that as well. I keep getting a "Run-Time Error 2302.
Microsoft Office Access can't save the output data to the file you've
selected." Any suggestions. I've looked and the file wasn't there afterward
and I've even tried saving the output to my hard drive and copying the file
to the appropriate location and still got the same results. Here's the
actual Do.Cmd I'm using if it helps:

DoCmd.OutputTo acOutputReport, , acFormatRTF, "M:\SFTS\IAAPExpired.rtf", True

Thoughts?
 
D

Dirk Goldgar

Charles said:
I guess I didn't put that in the original post. I'm sorry. I've
actually already tried that as well. I keep getting a "Run-Time
Error 2302. Microsoft Office Access can't save the output data to the
file you've selected." Any suggestions. I've looked and the file
wasn't there afterward and I've even tried saving the output to my
hard drive and copying the file to the appropriate location and still
got the same results. Here's the actual Do.Cmd I'm using if it helps:

DoCmd.OutputTo acOutputReport, , acFormatRTF,
"M:\SFTS\IAAPExpired.rtf", True

Thoughts?

1. Does the folder "M:\SFTS" already exist?

2. Do you have network permission to write to that folder?
 
C

Charles

Actually, I'm the Network Admin but I figured it out. When my predecessor
created the folders some time ago, he decided they would look all nice and
cute if there were spaces between the letters "SFTS" in the folder name. Why
is beyond me, but it was hard to notice until I clicked on the name of the
folder by accident rather than the icon. I was like "DOH?!?" So all this
time I had it right coding wise, just didn't have the folder info right.
Thanks all for your help.

Let's hear it one more time.... "DOH?!?"
 

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