Code question

Taxcop

Registered User.
Local time
Today, 14:25
Joined
Aug 16, 2001
Messages
12
I have a "name" field in a report that is created from two fields (last name and first name using [LastName]&", "& [FirstName]. Sometimes the last name is a business and the first name is null. How could I print just the last name field when the first name field is null. Thanks for the help.
 
I tried using the "+" operator but still got the ", " when the first name is null, i.e if the last name field is "Sears" and the first name field is blank the name field in the report is "Sears,". Can an if, then statement be used? I have tried to construct one but I know just enough about writing code to be dangerous. Thanks again.
 
Try

IIf(not isnull([LastName] & [FirstName],", " & [FirstName],[LastName])

This function says if there is something in the FirstName field, use the , FirstName.

If there is nothing in the FirstName field just display the LastName



[This message has been edited by charityg (edited 11-05-2001).]
 

Users who are viewing this thread

Back
Top Bottom