I am building a database that collects stakeholder email addresses for projects with the goal of automating the distribution of monthly reports for each project to those stakeholders.
I have three tables:
Project Master (primary key=Project ID)
description, project category, etc.
Stakeholder Master (primary key=Stakeholder ID)
Last name, first name, email address
Xref file (Primary key=automatic, with foreign keys to Project Master and Stakeholder master
Project ID, Stakeholder ID, Stakeholder type (a stakeholder might be a principal on one project, but an 'interested party' on another)
The data in the Xref table looks like this:
Project ID, Stakeholder ID, Stakeholder Type
12345, Abcd, Y3
12345, xyzz, Y4
12345, dddd, Y1
12345, ffff, Y2
12345, gggg, Y1
I want to be able to output the data to look like this:
12345, Y1:gggg;dddd, Y2:ffff; Y3:Abcd, Y4: xyzz
Depending on the type of project, the emails might go to :all stakeholder types, only Y3's, or Y1's and Y3's (there are a limited number of distribution rules, but more that one)
I am stuck with how to build this output. It looks like I have to build concatenated strings of Stakeholder IDs by Stakeholder type for each project ID.
I've tried a couple of the concatenation VBA's out, but I cannot make any of them work the way that I want them to.
Does anyone have any suggestions on an approach to building the strings of stakeholder IDs? Ultimately, I plan to pass these strings out to a Mail Merge in Word/Outlook, but I need to get this one piece of design figured out first.
Thanks in advance.
Bill:banghead:
I have three tables:
Project Master (primary key=Project ID)
description, project category, etc.
Stakeholder Master (primary key=Stakeholder ID)
Last name, first name, email address
Xref file (Primary key=automatic, with foreign keys to Project Master and Stakeholder master
Project ID, Stakeholder ID, Stakeholder type (a stakeholder might be a principal on one project, but an 'interested party' on another)
The data in the Xref table looks like this:
Project ID, Stakeholder ID, Stakeholder Type
12345, Abcd, Y3
12345, xyzz, Y4
12345, dddd, Y1
12345, ffff, Y2
12345, gggg, Y1
I want to be able to output the data to look like this:
12345, Y1:gggg;dddd, Y2:ffff; Y3:Abcd, Y4: xyzz
Depending on the type of project, the emails might go to :all stakeholder types, only Y3's, or Y1's and Y3's (there are a limited number of distribution rules, but more that one)
I am stuck with how to build this output. It looks like I have to build concatenated strings of Stakeholder IDs by Stakeholder type for each project ID.
I've tried a couple of the concatenation VBA's out, but I cannot make any of them work the way that I want them to.
Does anyone have any suggestions on an approach to building the strings of stakeholder IDs? Ultimately, I plan to pass these strings out to a Mail Merge in Word/Outlook, but I need to get this one piece of design figured out first.
Thanks in advance.
Bill:banghead: