Ok, so I have been working on a form that needs to have multiple attachments in it. (The easy part which I have already done; attaching the files.) The hard part which I will admit I am lost on, is displaying the name of the file not just an icon. Since the name of the attachment file contains alot of the information that I need, I need to see the name of the file.
Getting Access to Display the Attachment File Name
Collapse
X
-
sweet9red,
Plesae provide a little more information (especially some sample code). From just reading your question, I surmise that you already have the file name (becuase you say that you are able to attach it).
How do you want to display the file name? Plese provide a little more information and we'll be glad to take a look and try to guide you to a solution.
Grace and peace,
Twinnyfo -
Let's assume you have a Contacts Database with a Photo Field (Type Attachment). To list all of the Attachment Filenames, along with the First and Last Names of the Contacts, and File Types:
Code:Dim db As DAO.Database Dim rst As DAO.Recordset Dim rstComplex As DAO.Recordset2 Set db = CurrentDb Set rst = db.OpenRecordset("SELECT * FROM tblContacts") Do Until rst.EOF Set rstComplex = rst!Photo.Value With rstComplex Do Until .EOF Debug.Print rst![FirstName] & " " & rst![LastName], ![FileName], ![FileType] .MoveNext 'Next Photo Attachment for Contact Loop End With Debug.Print "********************************************************" 'Get the next Contact rst.MoveNext Loop 'Close out rst.Close Set rst = Nothing Set rstComplex = Nothing Set db = NothingComment
-
If you are using Outlook, and you want to do this within the email message, then this is a setting within Outlook, use the "plain text" format only. Icons and truncated filenames are the only way that the attachments will otherwise show within the program. Note this is a perclient/profile setting.
Your only other option within the email, is to follow ADezii's example with the slight modification of adding the file names to the message body text instead of the immediates window.Comment
Comment