Display DB Document With Button Click On Form

SerenityNet

Registered User.
Local time
Today, 14:54
Joined
May 6, 2003
Messages
27
I have documents (mostly Word) stored in an Access table. The table contains two fields. (1) a text field with the document's name and (2) an OLE field that holds the document.

When I press a button with the document's name on it (or it could be a hyperlink or a dropdown) on a form then I would like the document stored in the matching OLE field to open in the appropriate program for that document.

If I could set the permissions of the document to read-only then that would be great too. If I could prompt for read-only or read-write (no password necessary) access upon opening then that would be even better.

I can store documents in the table, but I have no idea how to launch them from a form button (or hyperlink, or dropdown).

Note: This is all within Access. This is not a web page related question.

Thanks in advance,
Andrew
 
re:

Hi,
you should NOT be storing these files within your Access application. You will run into a known bloating problem which will run into issues with the 2GB file size limit. Instead you should store the full string path/name to the external files in a text or hyperlink datatype. In case of a text data type you can then use the FollowHyperlink() or Shell() methods to open up the files at runtime. You could also use further code at runtime to manipulate the individual file's properties to open them however you want to.
Access 2007 will handle this much nicer with the new attachment data type which enables you to actually embed and attach multiple files to one record. For now you need to implement a workaround as earlier mentioned.
HTH
Good luck
 
Thank you for the quick reply. However, there is no point in me even putting them on the form, if they can't be stored in Access. I need to have a single file footprint for this application.

However, at most there will be three documents stored (two Word and one Excel). They should be read-only, if this is possible, so the documents should not change. And the DB is compacted upon close.

In this situation, will I still encounter the bloat you mentioned? If not, how can I launch them from the form?

Thanks,
Andrew
 
Last edited:
Okay, I've finalized on two static documents (one Word and one Excel) that will be stored in the table. I've experimented by opening and closing the documents many times from within the Access table. As long as the documents are static then there is no bloat that occurs.

However, I could still really use some help on learning how to launch the document from a button on the dashboard/controlpanel form.

Thanks and Happy New Year,
Andrew
 

Users who are viewing this thread

Back
Top Bottom