Others

How to Correctly Use the IIf Function to Filter a Microsoft Access Lookup List

Camila MilosovichCamila Milosovich Oct 28, 2026 868 views

Question details

The user needs to filter a Microsoft Access lookup list using a conditional expression but encounters an error due to a mistyped function name.

How to Correctly Use the IIf Function to Filter a Microsoft Access Lookup List
Product
Microsoft Access
Device & OS
not provided
Scenario
Reducing or filtering a lookup list based on a specific field value using a conditional expression in the row source or criteria.
Observed behavior
The system returns an error because the immediate-if function (IIf) was incorrectly typed as 'llf' (lowercase Ls) or 'Iff' due to small font sizes making the characters hard to distinguish.
Before you start

Ensure you have Design View access to your Microsoft Access database and consider increasing your screen's font size temporarily to easily distinguish between capital 'I' and lowercase 'l'.

Solution 1Recommended

Correct the IIf Function Spelling and Syntax

Fix typographical errors and apply the correct syntax for the immediate-if (IIf) function to resolve the expression error.

The most common cause of this error is mistyping the function name. Because of certain font styles, a capital 'I' can look identical to a lowercase 'l'. The correct spelling is 'IIf' (Capital I, Capital I, lowercase f). There is no built-in 'llf' or 'Iff' function in Access.

1
Open Design View

Open your Microsoft Access database, right-click the form or query containing your lookup list, and select 'Design View'.

2
Locate the Expression

Find the criteria row or the Row Source property where you entered your conditional expression.

3
Correct the Spelling

Change any incorrect spellings like 'llf' or 'Iff' to the correct spelling: 'IIf'.

4
Verify the Syntax

Ensure your expression follows the standard immediate-if format: IIf(condition, value_if_true, value_if_false).

5
Save and Test

Save your changes and switch to Form View or Datasheet View to confirm that the lookup list now filters correctly without triggering an error.

Correct the IIf Function Spelling and Syntax
Syntax Verification: Using the built-in Expression Builder in Access can help prevent typos, as it auto-suggests valid function names like IIf as you type.
Free Microsoft Office alternative

Manage Data and Conditional Lists Easily with WPS Office

While Microsoft Access is a specialized database tool, many users find that managing filtered lists and conditional data is much easier in a spreadsheet. WPS Spreadsheet offers powerful data validation, IF formulas, and a familiar interface to handle your list-filtering tasks effortlessly.

  1. 1. Download and Install: Download WPS Office for free from the official website and install it on your device.
  2. 2. Open WPS Spreadsheet: Launch WPS Spreadsheet and open your existing data files, or start a new workbook.
  3. 3. Apply Conditional Formulas: Use the standard =IF() formula or the Data Validation menu to create dynamic, filtered drop-down lists instantly.
Fully compatible with Microsoft Excel formats (.xlsx, .xls, .csv)Easily create dependent drop-down lists using Data ValidationUtilize powerful IF and nested IF functions without complex database queriesLightweight, fast, and completely free to use
microsoft office alternative - wps office

Frequently Asked Questions

Why does Microsoft Access show an 'undefined function' error for IIf?

This usually happens due to a typographical error. Ensure you have typed 'IIf' (two capital letter 'I's followed by a lowercase 'f') rather than 'llf' (lowercase 'L's) or 'Iff'.

What is the correct syntax for the IIf function in Access?

The correct syntax is IIf(expr, truepart, falsepart). You must provide the condition to evaluate, the value to return if the condition is true, and the value to return if the condition is false.

Can I use IIf to filter a combo box Row Source?

Yes, you can use the IIf function within the WHERE clause of the SQL statement in your combo box's Row Source property to dynamically filter the listed items based on specific conditions.