Running an Embedded object in a Form

M

Michael

Hello All.

I have been using access for a short while, and am fairly proficient with
querying and write VB code. However, I am completely new to developing forms
and reports. I was hoping you could help me.

The access database I am working with has a series of reference files
(word/pdf). Originally, these files were stored on a central server and we
provided links to them, but for various reasons we would like to embed them
in access. I was able to add each of the files into a table using the OLE
Object type with an associated name and description.

The difficulty comes when trying to create a form with these objects.
Essentially, I am trying to work towards one consolidated form that has each
file listed with a button you click to open it up. Any ideas? I tried to use
a wizard, but the form separated each file as a separate record (rightfully
so).

What I looking for:

Document 1: <Click to Open>
Document 2: <Click to Open>
Document 3: <Click to Open>

I greatly appreciate any assistance you could provide.

Thanks,

Michael
 
C

Curis

In all likelihood, you would be better off moving back to your original
method. Unless there is a truly good reason for doing so, storing documents
within the database like that will unnecessarily bloat the database and send
you to the 2gig file size limit much more quickly than simply storing the
path to each file in a text field of a table.

I am actually currently working on a database that handles document storage
this way and uses a nice bit of code from Dev Ashish's site to open the
document/image/etc using the associated application. Works very nicely.

Just my thoughts.
Jeff
 
C

Curis

Firstly, I must give thanks and credit to Dev Ashish. He is the one that did
it; I just copied and pasted his code and modified it as needed.

Now... for the opening of documents, I grabbed Dev Ashish's code detailed
here:

http://www.mvps.org/access/api/api0018.htm

Further, I implemented a call to the Windows File Open/Save dialog to
facilitate the users' efforts in locating files to be "attached" to the
database. That code is here:

http://www.mvps.org/access/api/api0001.htm

Specifically, my application has a table called tblSubpAttachments that
stores, among other things, the UNC path of the attachment file, and the name
of the file, and a brief description, each as text.

On a form called frmSubpAttachments, I have a list box displaying all of the
attachment files related to the main subpoena number. A user can
double-click any of the entries in the listbox (or select an entry and click
an Open button), and, using the code in the first link, I simply pass the
file path and name to the fHandleFile() function and it opens the document
using the associated application. I have yet to have a problem with it, and
it works with all of the basic file types that my users need.

Hopefully that will get you started.

By the way, if you are not already familiar with the mvps.org website, be
certain to bookmark it. It has a wealth of information and is absolutely
invaluable.

Good luck!
Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top