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!

Compare records in mail merge and show them in the same letter 1

Status
Not open for further replies.

mdafni

MIS
Jan 18, 2005
9
0
0
CY
Hi,

I have an Excel 2003 spreadsheet and i mail merge it with a word document. A sample of the spreadsheet is shown below:

client
name Policy_no plan_code fund1_val fund2_val
A 12345 8CP 200 100
A 12345 OP 231 0
B 23456 2G 564 200
C 56789 9SP 233 145
C 56789 OP2 543 150
C 56789 OP3 765 200

With these data I create a letter (using VBA - because according to the plan specific documentation is needed) to the client showing him the policy and the funds in which he invested. In some cases a policy might have an additional plan with investment in funds. Is there a way that I can show in the same letter to the client all the plans and the funds he invested? I saw in other forums mergeseq but I cannot understand how it works (you see I am new at these!)Any help will be appreciated.

thanks a lot
mdafni
 




Hi,

Yes. It will not be simple, but it is not difficult. Take a look at MS Query via Data/Get External Data. You will query your own workbook (database) for the sheet (table) containing the mailmerge source data. But you will have TWO tables. The first table is just the list of client key data. The second is the mailmerge source data.

Here's the drill.

1) write a simple loop thru the client list. In the loop you write the client key to a cell. This cell is the PARAMETER for your query.

2) use MS Query as a PARAMETER query to return the data for the client key. Here's wher you get one or more rows per client. The querytable can return within your "letter".

I'd suggest that any VBA code related questions be posted in VBA Visual Basic for Applications (Microsoft), forum707.

Post back with your questions.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Thanks Skip

I will try it and i will let you know how it goes.

Maria
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top