Autoformatting Tables with Pictures Dynamic Data Placement from Ac

L

laxonator

Ok, so I have an access database that right now opens a macro in Word and
merges one record with a specialized mail merge document. I copy the record
ID and then exclude all IDs but the copied one when I merge the document (via
macro). What I have done lately is include a subform which is designed to
store the local location of images and a caption for each image. What I am
trying to do is at the end of the automatted document continue on and place
the images and captions for that specific record. Each document will contain
approximately 10-20 images and captions and not a single image or caption
will be alike.

Hopefully I have not confused anyone. Please help with any
suggestions/comments/references, I am an amateur who gets by with books and
forums, this is by far the most difficult thing I've undertaken.
 
P

Peter Jamieson

Word mailmerge is not very good at dealing with the "mutliple records per
item" scenario you describe.

What I would probably do in this situation is write some Access VBA that
loops through all the records in the subform and uses Automation either to
insert an { INCLUDEPICTURE } field in your Word mail merge main document or
directly inserts the picture (which may give you more control over its
format). /Then/ merge the document. Of course you could probably avoid the
merge altogether by using Automatio to insert the other values as well, but
that is up to you.

Peter Jamieson
 
L

laxonator

Conceptually I understand where you are going and I agree, it seems as though
it would do the trick. However, I am a pitiful amateur and really can't code
anything in VBA for my life. I've done some C++ and various web based
markups, but VBA is beyond my scope of knowledge. I suppose I could go out
and find a book, and I might. Perhaps someone could show me a sample code or
something? I'm sure I could figure out the loop stuff online but what about
sending everything to Word? I'm just in a little over my head. Thanks to
all.
 
P

Peter Jamieson

Well, Doug Robbins gave a link to some relvant VBA code the other day - it's

http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

The code referenced by that article is more to do with merging a /single/
record but it might help ease you into working with VBA and Automation.

Creating an Access report to do this might also be a better option.

However, I'd assumed from your message that you had probably used VBA to do
what you needed. If you've just used merge fields, then you might be able to
extend that despite what I said. In essence, you would:
a. use a catalog/directory merge
b. use a data source that consists of one row per picture - every row has
to have the same structure so you cannot have one row for the "global
information" then one row per picture. What that usually means is that you
need to use an Access query to join the data captured in your main form and
the subform, i.e. the data in the main form would appear in every record.
c. Assuming you want a block of information at the beginning, with fields
from the main form, then enclose that whole block in an IF field that says

{ IF { MERGEREC } = 1 "put all the stuff you want at the beginning here" ""
} then put everything you want per picture here
d. ensure that the backslashes in the image pathnames (let's say they are
in a field called imagepathname) are doubled up, then use

{ INCLUDEPICTURE "{ MERGEFIELD imagepathname }" }

to include the pictures.

Peter Jamieson
 

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