Please Note: This article is written for users of the following Microsoft Word versions: 2007 and 2010. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier 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 April 20, 2018)
This tip applies to Word 2007 and 2010


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 (11220) applies to Microsoft Word 2007 and 2010. You can find a version of this tip for the older menu interface of Word 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

Adding Gridlines to a Table

You can easily add borders to your table cells. This tip shows you how.

Discover More

Checking for a Security Certificate

Although Word macro viruses haven't been commonly used for some time now, hackers often try old, known techniques just to ...

Discover More

Finding Boolean Values

Excel worksheets can contain all sorts of data. One thing you might store in a worksheet is a range of Boolean (TRUE or ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Mail Merge and Data Source Documents become Unattached

When you create a mail merge document, you attach it to a data source that is the basis for the information to be merged ...

Discover More

Grouping Records in a Mail Merge

Need to group records in some manner when they are used in a mail merge? It can be frustrating when your records are not ...

Discover More

Wrong Values Merged from Excel

When you use an Excel workbook as a data source for your merged document, you may be surprised if what is merged doesn't ...

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 1 + 1?

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 ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu 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.