Solved

TransferText acExportDelim gives # error message on SOME Access 2007

Posted on 2009-04-02
4
953 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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…

617 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