Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 31st, 2005, 09:01 AM
evansc evansc is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 258 evansc User rank is Private First Class (20 - 50 Reputation Level)evansc User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 4 m 16 sec
Reputation Power: 5
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

Reply With Quote
  #2  
Old November 1st, 2005, 10:55 AM
evansc evansc is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 258 evansc User rank is Private First Class (20 - 50 Reputation Level)evansc User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 4 m 16 sec
Reputation Power: 5
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?

Reply With Quote
  #3  
Old November 1st, 2005, 12:13 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > trouble saving output file to disk


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT