Solved

TransferText acExportDelim gives # error message on SOME Access 2007

Posted on 2009-04-02
4
946 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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