473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Mail Merge issue with data format

Access 2007

I have a data set that contains an (application, person, role). There is a one to many relationship [application] to [person].

app A, Bob, Owner
app A, Tom, Owner
App A, Bill, Developer
App B, Tom, Owner
My goal is to do an email merge into word. I'm fine if all the [person] get the email, but my problem is that I want to include a list of all the [person] for each application on each email

Application: App A
Recipient: Bob
Application Team: Bob,Tom, Bill
There is not a fixed number of members in each application team.

What is the best way to approach this issue. There seem to be two possible choices: 1. create a singe field with the application team in Access 2. Use word rules to do this upon merge. I've done some research but I can't figure out a straight forward way to do this (I'm pretty much a beginner with vb code)
Dec 5 '08 #1
3 1137
nico5038
3,080 Expert 2GB
Guess you'll need a roll up function, check this code:
Expand|Select|Wrap|Line Numbers
  1. Function fncRollUpField(strApplication as string) as string
  2. ' function to append multiple fields into one
  3. ' save function this in a module
  4. ' use in a query like:
  5. ' select fncRollUpField(application) from tblYours
  6.  
  7. Dim rs As DAO.Recordset
  8.  
  9. fncRollUpField = ""
  10.  
  11. Set rs = CurrentDb.OpenRecordset("select * from tblYours where application='" & strApplication & "'")
  12. ' nothing found
  13. if rs.eof and rs.bof then
  14.    exit function
  15. end if
  16. ' process records found
  17. While Not rs.EOF
  18.    fncRollUpField = fncRollUpField & ", " & rs!application
  19.    rs.MoveNext
  20. Wend
  21.  
  22. ' remove first ", "
  23. fncRollUpField = mid(fncRollUpField,3)
  24.  
  25. End Function
  26.  
Nic;o)
Dec 8 '08 #2
Great response, thanks! I'll see if I can get this working
Dec 8 '08 #3
nico5038
3,080 Expert 2GB
Keep me posted :-)

Nic;o)
Dec 8 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: webtrack+googlegroups | last post by:
I'm trying automate a mail merge in VB.Net as a spike/proof-of-concept. The resulting mail merge document should look very roughly like this: <<Customer FullName>> <<Customer Address>> Dear...
8
by: Ishbel Kargar | last post by:
Since upgrading from old laptop (Windows 98) to new laptop (Windows XP), my mail-merge letters are doing strange things with date formats. For instance, my reminder letter for lapsed subs carries...
8
by: Squirrel | last post by:
Hi everyone, I've created a mail merge Word doc. (using Office XP) , the data source is an Access query. Functionality I'm attempting to set up is: User sets a boolean field to true for...
9
by: Neil Ginsberg | last post by:
I have a strange situation using Access to automate a Word mail merge. Using Access 2000 and Word 2000, the code opens Word, opens the document in Word, sets a table in the calling Access...
8
by: Darryl Kerkeslager | last post by:
I hope that although this is 25% Access and 75% Word, that someone will know ... The whole problem here arises because 1) Microsoft acknowledges an 'issue' wherein TextInput type FormFields are...
3
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge...
1
by: ashkash | last post by:
I have an access database which takes information from a user and then uses the mail merge functionality to merge the data into a word document. I have a lot of subforms in the access database which...
1
by: mr k | last post by:
Hi, I wanted to use mail merge with forms but Text form fields are not retained during mail merge in Word, I got the code from Microsoft but it doesn't remember the text form field options such as...
1
by: Esther Lane | last post by:
Hello! First off, many many thanks to Albert who wrote the Mail Merge code for MS Access I am using. It has been working beautifully for a few years. However, my client just (without notice!)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.