Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Getting Rid of Blank Labels in a Filtered Merge.

Getting Rid of Blank Labels in a Filtered Merge

Written by Allen Wyatt (last updated September 16, 2022)
This tip applies to Word 97, 2000, 2002, and 2003


Peggy experienced a problem printing merged labels from a filtered database. It seems that the labels she wanted were printing out, but the printing was also kicking out a blank label for every record filtered out of the merge.

Quite honestly, this problem should not occur in Word. If you use the standard Mail Merge Wizard, it sets up your labels so that you don't get blanks; you only get the labels you want. If you are not getting that, then the most likely culprit is the actual main document created in Word. You can try this:

  1. Open the main document—the one that you use to merge with your data.
  2. Press Alt+F9. This should display all the field codes in the document.

Merging is accomplished through the use of field codes. If the codes are incorrect, the merging is not done properly. The purpose of the Mail Merge Wizard is to get enough information from you that Word can set up the field codes properly.

When printing labels, the field codes specify where the individual bits of information go that make up each label. Your document should consist of a table, with each cell of the table responsible for a single label. What you are looking for right now is the composition of the first label, in the upper-left corner of your table. This is your base label. Every other cell in the table should look the same as this base label, with the exception of a {NEXT} field at the beginning of the label. This field, when encountered during a merge, causes Word to proceed to the next record in the source data.

If, after examining the field codes for your labels, you discover that they are not the same (with the exception of the {NEXT} field), then you need to start over and use the Mail Merge Wizard to again create your main document.

Another thing to check is the actual filtering that you are doing. If you are filtering your data records based on a non-printing field, it is possible that the filter is not functioning according to your expectations. In fact, it might not be filtering at all, and you can't tell because you never print the field on which you are filtering. Check to make sure that the filter is set up properly.

If you still run into problems, then you could check your source data. For instance, if you are using an Access database as your data source, you could define a query in Access that defines the labels you want to print. Use this query as the data source in Word for your mail merge. Thus, Word is not doing the filtering, but Access is handing Word data that has already been filtered.

Finally, you can get rid of records that have blank fields by using the {NEXTIF} field in your labels. This field code checks the contents of a specific field against a criterion that you set. If the criterion is met, then the merge proceeds to the next record in the data source. Why would you use such a field? It is very helpful if your data source contains a lot of records that are only partial—for instance, you may have data records that record a first name but not a last name. Consider the following field code, which could be placed at the beginning of a label:

{ NEXTIF { MERGEFIELD LastName }= "" }

This checks the LastName merge field, and if it is empty, the record is skipped and Word proceeds to the next record.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1790) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Getting Rid of Blank Labels in a Filtered Merge.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Synchronizing Lists

Two lists of similar data can be challenging to synchronize. Here are some ways that you can align data in two different ...

Discover More

Using Strikethrough Formatting

Need a line through the middle of your text? Use strikethrough formatting, which is easy to apply using the Format Cells ...

Discover More

Turning Off Automatic Hyphenation for Parts of a Document

Word can hyphenate documents automatically, if you want it to. But what about those situations where you want most of a ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (menu)

Merging and Printing

When you merge information into a document, Word provides two different ways you can create your output. Here's an ...

Discover More

Data Source File in Word 2003

The security features introduced in Word 2003 resulted in a change in the dialog boxes you see when opening mail-merge ...

Discover More

Using Merge Fields

When creating a mail merge document, you use merge fields to indicate where the information from each record of your data ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 8?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.