Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TransferText acExportDelim gives # error message on SOME Access 2007

Posted on 2009-04-02
4
Medium Priority
?
963 Views
Last Modified: 2012-05-06
I am using the code to attach a text file to an email. The weird thing is that this works perfectly on 3 machines and on th eother 3 it gives the error Runtimne error 3011, the Microsift Access database cannot find file 'Millvile_sandf#txt' Make sure the object exists...

It seems to me that the 3 messing up look at this as an import , not an export as called out. Ideas?
When I land my mouse on the filename in debug it is correct.
Public Sub Command78_Click()
DoCmd.SetWarnings False
    Dim strErrMsg As String 'For Error Handling
    Dim olApp As New Outlook.Application
    Dim olNameSpace As Outlook.NameSpace
    Dim olMail As Outlook.MailItem
    Dim oleGrf As Object
    Dim strFileName As String
Set olNameSpace = olApp.GetNamespace("MAPI")
Set olMail = olApp.CreateItem(olMailItem)
grantee = DLookup("[grantee]", "grantinfotable")
sandf = "c:\" & grantee & "_sandf.txt"
commev = "c:\" & grantee & "_commev.txt"
parev = "c:\" & grantee & "_parev.txt"
schev = "c:\" & grantee & "_schev.txt"
Play = "c:\" & grantee & "_play.txt"
Sites = "c:\" & grantee & "_sites.txt"
DoCmd.TransferText acExportDelim, , "Scope and Fidelity", sandf, True  <- ERRORS ON THIS LINE
DoCmd.TransferText acExportDelim, , "Community Events", commev, True
DoCmd.TransferText acExportDelim, , "Parent Events", parev, True
DoCmd.TransferText acExportDelim, , "School Events", schev, True
DoCmd.TransferText acExportDelim, , "Sites", Sites, True
DoCmd.TransferText acExportDelim, , "play", Play, True
With olMail
    .To = "DHagerman@NJHI.org"
    .Subject = grantee & " - Scope and Fidelity Data on " & DATE
    .Body = "Data is attached. Save data on drive, then import to program."
    .Attachments.Add sandf
    .Attachments.Add commev
    .Attachments.Add parev
    .Attachments.Add schev
    .Attachments.Add Sites
    .ReadReceiptRequested = False
    .Send
End With
 
MsgBox vbCrLf & "Data has been emailed! If asked be sure to answer YES to the Outlook prompt.", vbOKOnly
 
 
command78_Click_Exit:
Set olApp = Nothing
Set olMail = Nothing
Exit Sub
End Sub

Open in new window

0
Comment
Question by:gaynes
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:sreindl04
ID: 24054575
maybe too simple, but service pack missing?
0
 

Author Comment

by:gaynes
ID: 24054696
nope - checked that
0
 
LVL 3

Expert Comment

by:sreindl04
ID: 24054724
ok. Now there's something completely different: Sure about the hash (#) in the filename?
0
 

Accepted Solution

by:
gaynes earned 0 total points
ID: 25572635
This was a network admin error.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question