Daniel Webster College
 

Tip of the Week

WORD

MAIL MERGE TESTING

Have you ever wished you could customize the contents of a merge letter based on the values stored in a merge field? You can do just that with the If...Then...Else... merge field.

Let's say that in your monthly statement to your customers, you want to show the number of transactions for the month, a number that is stored in your data source in a field called TransCount. If the value in TransCount is 1, you want to print "1 transaction." If the value in TransCount is 0 or greater than 1, you want to make the word "transaction" plural, as in "0 transactions" or "22 transactions."

Here's how to do that:

1. Go to Tools | Mail Merge and edit your main document.

2. On the Mail Merge toolbar, click the Insert Merge Field button, and select TransCount.

3. Press the spacebar after the <<TransCount>> field and type "transaction" in the main document. 

4. Click the Insert Word Field button and choose If...Then...Else.... 

5. Select TransCount in the Field Name dropdown list, choose Equal To in the Comparison dropdown list, and type 1 in the Compare To field. (Leave the Insert This Text field blank.) 

6. In the last field, Otherwise Insert This Text, enter the letter "s" and click OK. 

Now, when you run your mail merge, the If...Then...Else... field will return nothing when the value in TransCount is 1, so the phrase in the merge document will appear as "1 transaction." In all other cases, the field will return the letter "s" which turns "transaction" into "transactions."

----------------------------------------

EXCEL 

EXPAND IF TESTS

One of the first functions beginning Excel users learn is the IF function, which takes the form =IF(condition,true_result,false_result). When you use this function, you typically test only one condition at a time. For instance, in the formula =IF(A1>10,"Great","Average"), the only condition being evaluated is whether the value in cell A1 is greater than 10. 

Sometimes, however, you want to display a result depending on whether any one of multiple conditions is true. For example, suppose you need a formula that says: If A1 contains 10, or if A15 is greater than 20, or if A25 is less than 100, then display "Great." However, if none of those conditions is true, then display "Average."

You create such a formula in no time by combining the IF and the OR functions. The OR function takes the form OR(condition1, condition2, condition3), and evaluates to a logical true value if any of the conditions is true. If all of the conditions are false, then the OR function evaluates to a logical false. In our example, the formula would take the form =IF(OR(A1=10,A15>20,A25<100),"Great","Average").

The OR function will evaluate to true, and the formula with return "Great," if any of the three conditions is true. If all three of the conditions evaluated by the OR function are false, the OR function returns a value of false and the IF test returns "Average."

----------------------------------------

ACCESS 

CONVERT BACKWARDS

When you want to convert an Access 97 (or older) database to Access 2000 or 2002, the process is straightforward: Launch Access 2000, go to File| Open, navigate to the old database, and click OK. At the Convert/Open Database dialog box, you'll have the choice of converting the database to the new format or opening it while maintaining backward compatibility.

However, if you need to convert an Access 2000 database back to Access 97, File | Save As won't help--but you can still convert an Access 2000 database into a format that Access 97 can use.

To do so, follow these steps:

1. Open the database, go to Tools | Database Utilities | Convert Database, and select To Prior Access Database Version.

2. Enter a new name in the Convert Database Into dialog box. The file extension will remain the same, MDB.

As is typically the case when you convert any program file to an earlier format, in the conversion to the older version you may lose some features or functionality that existed in the newer version.