|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
trouble saving output file to disk
I've created a query that for the purpose of a mail merge in word. The following is supposed to run the query and then send it to Excel and save it. It won't save to the file I've provided (or to any other file). Any ideas?
Code:
Dim strQuery As String
Dim strCaseNumber As String
Dim myPath As String
Me.txtCaseNumber.SetFocus
strCaseNumber = Me.txtCaseNumber.Text
myPath = """C:\Documents and Settings\All Users\Shared Documents\MailMerge.exe"""
strQuery = "SELECT etc., etc. "'"
DoCmd.OutputTo acServerView, strQuery, "MicrosoftExcelBiff8(*.xls)", myPath, False, "", 0
End Sub
|
|
#2
|
|||
|
|||
|
I'm still having difficulty - I thought maybe it tried to save the file with name being the select statement. So I changed how I was doing it, made a report, and figured I'd save it that way. Here's my new code:
Code:
Dim myPath As String
myPath = """\\documents\offices\Judicial & Court Services\Technology Resources\Shared Project Folder\"""
DoCmd.OutputTo acReport, "rptMailMerge", "MicrosoftExcelBiff8(*.xls)", myPath
If I run it without the "myPath" variable it just prompts me for a save location - it's works perfectly. But as soon as I try to save it, I get a message that Access can't save to that location. It doesn't matter what location it is - it won't save anywhere unless I do it manually. Any ideas? |
|
#3
|
|||
|
|||
|
If you step through with the debugger does mypath look correct?
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > trouble saving output file to disk |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|