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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
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…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

910 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

19 Experts available now in Live!

Get 1:1 Help Now