TransferText acExportDelim gives # error message on SOME Access 2007

Posted on 2009-04-02
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 = ""

    .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


End With

MsgBox vbCrLf & "Data has been emailed! If asked be sure to answer YES to the Outlook prompt.", vbOKOnly


Set olApp = Nothing

Set olMail = Nothing

Exit Sub

End Sub

Open in new window

Question by:gaynes
  • 2
  • 2

Expert Comment

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

Author Comment

ID: 24054696
nope - checked that

Expert Comment

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

Accepted Solution

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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now