From the computer of: solveig
(2 recipes)
Created: Feb 25, 2007 Updated: Mar 26, 2007
When you have information from multiple records on the same sheet of paper, in mail merges for lists, downloaded label templates, and other mail merge documents, you'll need to do something extra if you want more than one record on each sheet of paper. The first sections of this article explains how mail merges work regarding when the next record is chosen, and why. If you're already familiar with this, go straight to the solution in the third part of the article.
A mail merge is a connection between a document and a database. The document pulls information for certain fields, like Name and Address and Birthdate, out of the database. You set up your mail merge document like this.
Figure 1: Setting up the mail merge document
The information for the first record (the first person in this case) is printed, then the second record, and so on.
Figure 2: The printed results of a mail merge
Here's the question, though.
When you do you go the next record? What makes the mail merge document switch so that we see the information about Miranda?
In labels, it makes sense for information about the next record to show up in the next label, which is the next time that the field appears. And that's how it works when you create labels—at least, when you create labels by choosing File > New > Labels. If you're using different label templates, though, you get the same name and address in every label area until you go to the next page. 10 or 30 labels for the same person. The logic to trigger the next record isn't built into those templates.
In regular documents, like a report listing the people in the department and their birthdates so you could remember to have cake on the appropriate days, then you would also want new information every time the field appearead again or every time there's a carriage return.This is how things work when you use the report wizard, but it's not how things work when you create a mail merge from scratch.
So the question is, when you're using templates or your own documents that aren't based on OpenOffice.org wizards, how do you trigger the Next Record without waiting for the next page?
That's because the default behavior is designed for what the programmers think is the most common use for the mail merge feature; the standard letter. If you're creating a mail merge letter, you sometimes want the same information for one record to repeat. Sometimes your letter goes for three pages. It certainly doesn't make sense to show information from the next record after each carriage return, or the next time the field shows up.
Here's how you might set up a typical mail merge letter.
Figure 3: Setting up a mail merge letter
Here's what it would look like if you triggered a new record each time you got a new carriage return, reuse of a field, or new page.
Figure 4: Unfortunate results of a mail merge that flips to the next record each time a field appears again
Here's a summary of how a new record is triggered by default for each type of document.
Documents that work correctly and don't need modification or which can't be modified
Documents that sometimes need modification. You can change these, so don't worry—it's just a description of the default behavior, not what you're stuck with.
It took me a whole lot longer to explain the problem and the default behavior than it's going to take to describe the solution.
Every time you want to trigger the next record, choose Insert > Fields > Other, Database tab. in the Type column select Next Record, and in the Database Selection list select your database and table. Click Insert.
Figure 5: Inserting the Next Record trigger
You will see either nothing appear in the document, or a very small grey speck. If you insert it by itself you'll see it, but you won't see it when you insert is, as you typically will, next to another field.
Figure 6: How the Next Record field looks (at its most obvious)
You don't even need to click Insert every time. You can copy and paste that small gray field to the next line, or the next label, or, another four inches down the page—wherever you want the next record to begin.
Here are a couple ways you could use it.
In labels you create from WorldLabel templates or other templates, set up the first label normally and copy it to the second label area too. Then insert the Next Record field in front of the FirstName field in the second label area, and copy the whole label. Paste it to all the other label areas in the template. You only need to insert the Next Record field once per record; not in front of each field.
Figure 7: Using the Next Record with labels
If you don't want to use the Reports function in the database management window, or if you just want something simpler, you could set up a report like this. Drag the first line of fields out, then press Return and copy and paste them to the second line.
Click to the left of the first field in the second line and insert the Next Record field. You only need to insert the Next Record field once per record; not in front of each field.
Now copy that second line and paste it again until you've filled the page.
Figure 8: Setting up a report using the Next Record
As we know from using LaTeX and Word, having control over exactly what you want to do doesn't always mean it's easy to figure out. There are two logical and very different ways for the mail merge to work. OpenOffice.org chose one, and if you want it to work the other way, well, it's just a matter of inserting the Next Record field. On the plus side, you only need to set up your label template once, then use it again each time you print new records.
About the Author:Solveig Haugland has worked as an instructor, course developer, author and technical writer in the high-tech industry for 16 years. She is the author of the OpenOffice.org 2 Guidebook and blogs about OpenOffice.org at openoffice.blogs.com. To inquire about OpenOffice.org training and consulting, see her business site or email training@getopenoffice.org.
Subscribe to the Tech-Recipes Newsletter
You can get tips like this delivered in your email every week!
We will never, ever sell your email address or spam you.
Related recipes:
Creating Databases the Quick, Easy Way With OpenOffice.org
OpenOffice.org: Play TicTacToe (Easter Egg)
OpenOffice.org: Play StarWars Galaxy (Easter Egg)
Prevent OpenOffice Calc from capitalizing first letter
Making Labels with Openoffice.org Templates
Sponsored links
Login
Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.Search
Tech Recipes
· Home
· Mac OS X
· Solaris
· Windows
· Programming
· UNIX
· Cisco
· MySQL
· Google
· Instant messaging
· Add recipes
· Leave feedback
· Recommend us
· RSS Syndication
Hot recipes
XP: Small, Free Way to Use and Mount Images (ISO files) Without Burning Them
Make XP look like Windows Vista / Longhorn for free!
Vista: Should I Install 64-bit or 32-bit Version? (x64 vs x86)
Hacks to Beat Rapidshare Download Limits and Waiting Time
How Do I Use or Open Bin, Cue, or ISO Files?
SMS through E-Mail: Cingular, Nextel, Sprint, T-Mobile, Verizon, Virgin Mobile
MySpace Hack: View Pictures and Comments on a Private Profile
MySpace: Hack to Dowload Any Song on Myspace
Who's Online
There are currently, 1960 guest(s) and 1 member(s) that are online.
You are Anonymous user. You can register for free by clicking here
Information
Wish to advertise with us?
All logos and trademarks in this site are property of their respective owner. The comments and forum posts are property of their posters, all the rest © 2003-2007 by QD Ideas, LLC.
Users of this site are legally bound by the Terms and conditions and Disclaimer. Do not use this web site if you do not agree with these policies.
The members, admins, and authors of this website respect your privacy.
Page Generation: 0.70 Seconds
Sun Sep 7 18:11:02 2008