View Single Post
 
Old 12-02-2015, 10:30 PM
AndyS AndyS is offline Mac OS X Office for Mac 2011
Novice
 
Join Date: Dec 2015
Posts: 6
AndyS is on a distinguished road
Default I want to create a lists within lists (nested merges)

I have Microsoft office for Mac 14.5.8 running on OS X 10.11.1.

I have a basic level of VBA programming skills.

My requirement is to generate a WORD document cataloguing a number of artworks with, for each work, a page containing details of the work and a list of the exhibitions it has been in. The first bit I can do with mailmerge, but I don’t know how to make the embedded list of exhibitions for each work. I want to create a line for each exhibition, so it is like a mailmerge-within-a-mailmerge. Is this possible with VBA? (I don’t necessarily have to use mailmerge if there is a better way).

I currently have an EXCEL workbook functioning as a database for the artworks with a table on each worksheet (tab). This could be migrated to SQLLite or similar if that helps. Exhibitions can tour, so location is a separate table; an exhibition will take place at one or more locations, so ideally I want to list the locations for each exhibition as well, giving two levels of embedding.

Tables:
  • Object: entry per artwork with fields like: artist, title, materials and measurements; keyed with an object_id.
  • Exhibition: name, catalogue reference; keyed with a short name (acronym) as exhibition_id
  • Location: name of a location at which exhibitions are held; keyed with a short name (acronym) as location_id.
  • Object-Exhibition: object_id, exhibition_id, catalogue number. Indicates which works appeared at each exhibition.
  • Exhibition-location: exhibition_id, location_id, start date, end date. Indicates which exhibitions were held at each location.
If anyone can give me some sample code, and/or point me to where I can find instructions, I would be most grateful!
Reply With Quote