automatic attachment file

Sadie Hewgill

Registered User.
Local time
Today, 16:33
Joined
Oct 18, 2010
Messages
52
I'm using Access 2007 and the attachment data type on a form, but it would be nice not to have to browse to the file I want each time. Is there a way to automatically retrieve the file I want for the attachment based on the file name being written in a different field on that form? For example, for each record, there is a .jpg file to be attached. All of the .jpgs are stored in the same folder, so that path would always be the same except for the file name itself, which would be the contents of another field with .jpg added on the end. I still want to be able to edit attachments or add other attachments to each record, but the .jpg attachment will always be there.
Any ideas how to do this?
Thanks,
Sadie
 
Have you considered using the FollowHyperlink approach to open attached files.
 
no i hadn't heard of that before, that's interesting, and I found Hyperlink.Follow will get the path from a control on my form. But it is the same as clicking a hyperlink to open a file. Will this pull up a new window for the picture or will it save as an attachment and show up in the attachment field when I open the record? I am hoping to be able to do the latter.
 
If you have more than one file as an attachment to a record you need the attachments type field. If you only have one jpg then you can store the file name and use this to open via the hypelink.follow syntax

What are you anting to do with the attachment?
 
I do want to use the attachment type field, just the way it is meant to be used for displaying .jpgs and holding other attachments. I want the attachment to be added to this field automatically, not opened automatically
 

Users who are viewing this thread

Back
Top Bottom