OutputTo path problem.

telco25

Registered User.
Local time
Today, 12:14
Joined
Feb 1, 2001
Messages
11
Hello,

Need help again. I believe I'm close but no bananas! Trying to get a report generated from data inputted in a order form so when the user clicks on a command button it will output this form to the correct subdirectory with the order number as report name. I have done something similar with sending this report via email and it works, but somehow I'm not quite there with the OutputTo. Here's what I am doing so far:

Dim stDocName As String
Dim stOrderNum As String
Dim stSubject

StOrderNum = [Forms]![INPUT FORM]![ORD_NO]
StDocName = "COMPLETED ORDER"
StSubject = "stOrderNum"

DoCom.OutputTo acReport, stDocName, acFormatRTF, \\Serv001\Mkt\Orders\Comp\stSubject,True

I can get this to the correct subdirectory but it's saving it as "stSubject" instead of the order number (like 9256.rtf). When I have done this same thing sending it through email, it does rename the report to the order number. Anyone have any ideas where I'm off?

All help is appreciated. Thanks in advance.
 
Try something like this:

stSubject = "\\Serv001Mkt\Orders\Comp\stOrderNum"

Then use that in the OutputTo. Right now, Access thinks that your stSubject in the OutputTo is just part of the literal...
 
Thanks, Chris.

Tried what you suggested, but still getting the same results as before. I may have gotten closer though, I have the path "\\...\...\stOrderNum.doc". The end users seem to think this is doable since they have to move it to the correct sub-directory when they save it anyway. Appreciate your help.
 

Users who are viewing this thread

Back
Top Bottom