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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command button

Status
Not open for further replies.
Jul 30, 2007
42
0
0
US
I have a form created with multiple text fields for users to input the information and the data is saved in the access table. How do I add a button to the form for user to attach a word document for each item the user has entered into the form. The word document is different for each item. Do I need to add a column to my table in order to save that document?? Any help will be greatly appreciated.
 
It seems as if your database is not normalized. You may wish to read
Unless you are using an Access 2007 database, it is best to store the path to the document, rather than the document itself. You can add a little code to an On Click event to allow users to view the document (FollowHyperlink).
 
Yeah. I concur. When I made an inventory database in access, that stored photos of all the object it was inventorying, I found it very unwise to have OLE objects or image files stuck in a field of the database. When you pass the 50 or 100-record mark, you're gonna regret it.

Rather, if you feel up to it, have the button display a file selection windows where the user picks the file to add. Someone actually wrote up some code on this that you can stick in a module in your project.. (check out Then have the program plop the path to the file in a field in your database. Your searches are going to benefit a LOT, since it will just be a bunch of text data, without all of the OLE shizzle that microsoft can clog your DB up with.

One thing that sucks though is that Access does not support the OLE DragDrop method, and so you can't do like with a VB form where the user drags the file on the box and the DragDrop even passes you the path programmatically. Trust me on this 'cause I looked far and wide. Oh well,, hope your form comes out nice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top