Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TransferText acExportDelim gives # error message on SOME Access 2007

Posted on 2009-04-02
4
Medium Priority
?
958 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

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
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…

722 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