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

Access report or Word document?

Status
Not open for further replies.

teknet

Programmer
Jul 25, 2005
6
GB
I'm developing a database storing information and several photos for each record (the photos aren't actually stored in the database - just the filename of the image which is displayed through an image control).

I need to be able to print off reports with the photos included and I also need users of the database to be able to change the layout of the reports and change some fixed text on the reports themselves.

I'm looking for guidance on whether it is better to create Access reports or link to external Word documents. I can see editing a word document is easier for my users but not sure how I'd get the photos into Word when I'm only storing the path and filename of the image in my Access database.
 
Hi

You could use text in a table, which the user could amend, to provide the facility to allow the user to amend the "fixed" text in a report, but amending the layout would probably be easier witha word document. Why not use an image control in the document to display the photographs? It would mean having "rules" which the user must follow, with respect to naming any such controls

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
teknet,
One option is to have a table with a field of OLE Object type. Here you can easily store docs with pics. Double-clicking on the record opens word and all editing, inserting, etc can be done this way.

The method of storing the docs outside access and just storing the path is also a good way to go--you have a smaller .mdb this way, you just have to make sure you maintain the paths, but this is a common way of doing it. With that method, you can still use the Word.Application object from within Access and kick off instances of Word from an Access form to do the editing, and you can also insert pictures via code acting on the Word.Application object.

It sounds to me that using the Doc rather than an Access Report is the way to go for your situation, and keeping the docs as separate files and just store the paths, as you can easily email these docs, whereas emailing Reports is troublesome--you need the target to have the Snapshot Viewer, the right version, etc., which is a headache.
--Jim
 
Thanks guys,

I've been looking around for methods of inserting the images into word but aren't sure how to do it - can I open the application object in Access and then insert the photo from access or do I need to code the control in word to read the image filename from access?

I'm currently doing it using mail merge in word whilst I experiment but this means that my button in access opens the source document and you then have to merge it yourself. Is there a way of automatically merging the document and just showing the finished document or is mail merging not the best way of doing it?

Steve.
 
teknet,
If you go the route of OLE object in a table, you just go to the menu and do Insert...and it'll prompt for a dialog box to insert the doc.

With using code, you can basically do anything in code on the Word.App object that can be done by hand--including inserting pictures based on a variable holding the image's path that you'd read from a table.

When it comes to showing the doc, you can either shell() a word instance or open it from the word object, and Word will open with the doc you supply via a path variable. Or, if you go the ole route, just double-clicking on the table or form record will open it, showing the pictures, etc. in a word window within access.
--Jim
 
Thanks,

I'll have a play around and see what I come up with.

Cheers!
Steve
 
I've managed to open a word mail merge document from access but the only way I can get it to display a picture is by having the merge field {INCLUDEPICTURE {MERGEFIELD "fldImage"} \d \* MERGEFORMAT} in the document.

This works but only if you select all and press F9 to update the document (otherwise the picture doesn't display) which is a little confusing for my users but looking on the web there doesn't seem any other way of merging an image.

It also shows the image full size and I can't see how I can restrict the size (using clip or stretch or zoom) for this image control that is part of a merge field?

Maybe mail merging isn't the best way?

Thanks, Steve.
 
Rather than use MailMerge you could use Bookmarks.

You can locate a bookmark with:

Selection.GoTo wdGoToBookmark, "qwerty"

and place a picture at that location with:

Selection.InlineShapes.AddPicture PathAndNameOfPictureFile, False, SaveWithDocument:=True

Hope this helps.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top