A large part of your headache (see "headbang" emoji) is caused by not protecting yourself earlier in the design phase.
First and foremost, this is a nightmare for you because your nomenclature tells me your tables are most likely not normalized. With a normalized table structure, there is no need to search field #1 or field #2 for the same value.
Second, I don't know how you would be getting your data into your system, but it seems to me that if you have any input into the design of this system, you would take steps to "head this off at the pass" so that you don't have to do an IIF at all because you would stop the system from storing nulls in a field you intended to search.
This forum has an excellent SEARCH feature in the blue ribbon at the top of each forum page. Look for "normalization" to see how to structure your data in a way that makes it more searchable without the brick bruises to the forehead. You can also do a web search for this topic, but to keep from getting extraneous hits, try "database normalization" when doing the web-level search. (Otherwise you will get diplomatic normalization, formula normalization, etc.)
I'm going to ask a simple question that will highlight your problem in the proper light. What do you do with three defendants? How many defendants can a case have?
Here's the way I might approach this (and intended as the 10,000 foot overview)
Table: Cases
- CaseID (whatver you used for UNIQUE case identification)
- CaseName (smith vs. jones ... State of Louisiana vs. John Doe etc.)
- other stuff about the general concept of the case
Table: Defendants
- DefendantID (some sort of ID number, maybe even an autonumber)
- CaseID - Foreign Key that says "this person is a defendant in the indicated case"
- DefendantLastName
- DefendantFirstName
- DefendantMiddleName
- DefendantOrdinal (if it is important to know which defendant was named first)
- other defendant info
You don't say whether this is criminal or civil so I can't tell what other tables you might need.
Query: SELECT {a bunch of fields including CaseID, DefendantLastName, other names and other case info} FROM Cases JOIN Defendants ON Cases.CaseID = Defendants.CaseID ect.
Then when you do your search, search the QUERY to find a defendant and see which case (or cases) are associated with that person. If you have only one defendant, that is what is in the table for that case. If you have 20 defendants, you have 20 entries in the table for 1 case. But when you search, there is only one column and no need for an IIF to look for nulls. Because if you do this sort of thing, you don't ever HAVE nulls. If you don't have a defendant's name, you don't enter a record and then don't ever have to search it.