Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attach a file to a record 2

Status
Not open for further replies.

cheyenne2002

Instructor
Jul 26, 2005
229
US
Is there a way to attach a file to a record.

My boss wants to be able to attach a file to a record so that when he views a particular record if there is a contract to go along with that record he can click on a button and then the other document (which might be a pdf, doc or something else) opens.

Is this even possible and how difficult is it. I'm a novice.
Sam
 
are you viewing the record on a form? it is very possible to do this sort of thing depending on how you are viewing the record and how you want to associate the other document. give a bit more specific information about what you have so far. let's work together to wow your boss :) he can see it in various ways .... simple or advanced.
 
I think he just wants to be able to open the other file from the form.

He has a record of a piece of property that he wants to sell. He may have a contract that is a Word doc or a jpg or pdf file. I think a like from the Access form that when clicked would open the other file would fill his needs.

Thanks
Sam
 
How are ya cheyenne2002 . . .

Better to have a field in the proper table for storing the Path & Filename.

Have a look at the [blue]Shell[/blue] function!

Calvin.gif
See Ya! . . . . . .
 
I'm doing okay AceMan1. Just can't wait for this project to be over. I don't think I will ever tell anyone I know Access.....ever again. They always want more than I know and when I do finally figure out what to do they always ask for more.

I'm still trying to figure out the search for keywords..... I just had him send me a list of the field he MUST have search capabilites in. I have a phone meeting with him tomorrow am.....wish me luck...

hmmm, I wonder if I can get him to store the documents in the right path each time. He is not as PC literate as I would like, but then he would not need me.....

I will look at the shell feature.

Thanks
Sam
 
StriveForExcellence & AceMan1,

Okay, I'm ready to start working on attaching a file to a record or putting a path (or more) on a record so that a scanned document can be opened from within the database.

I'm open to any and all suggestions as I have no idea on how to accomplish is. I'm pretty sure it can be done, but as to the "How To".....well there in lies the problem.

I need something that I will be able to do, please keep in mind I'm still new at this and don't know a lot of coding.

Thanks for your help and guidance.

Sam
 
One thing I forgot to mention is that this needs to be totally user friendly. The person attaching the file will NOT be working in the background of the database, they will only be a data entry person.

Any thouhts?

Sam
 
You can have a field in the table which I'll call Attachment for this example. The data type needs to be OLE Object. On your form you need to have a bound object frame which I'll call tvwAttach for this example. You can have a button on the form that will call up the insert object dialog box by placing the following code in the on_click event:
Code:
tvwAttach.Action = acOLEInsertObjDlg

From there, the users can select to 'create from file' where they navigate to the file using the Browse button and then may choose whether or not to link to the file. It is best to link as long as the file will not change locations. This will save a lot of space in the database. In addition, any changes that are made to the files outside of the database will be reflected when they are viewed using the link inside the database. I also recommend using 'display as icon'. It just looks better. The file can be opened by double-clicking on the icon.
 
This is great. Thank you.

As the user ended up wanting to be able to add about 9 attachments, I created teh OLE Object field for each one. I have instructed the user to right click in the field and then follow the Insert Object from file.......

Thanks again
 
I want to thank Tigerlili3 for the excellent reply. Is there a way to get the name of the file selected by the user from the Insert Object dialog box? I want to save the name of the file and put it in a separate text field.

Thanks, haccster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top