Others

Fix an Access IIf Default Value Expression That Always Returns False

John WilsonJohn Wilson Nov 18, 2026 870 views

Question details

The user needs to compare FROM_USER_NAME with the text tacpk and return the appropriate result for each record.

Fix an Access IIf Default Value Expression That Always Returns False
Product
Microsoft Access
Device & OS
not provided
Scenario
A table field has an IIf expression in its Default Value property that refers to another field in the same record.
Observed behavior
The expression returns the false result even when FROM_USER_NAME contains tacpk.
Before you start

Open the table in Access and confirm the exact field name and table name. Check that the value to compare is the text tacpk and note the true and false results you want.

Solution 1Recommended

Calculate the IIf result in an Access query

Use a query when the result should reflect the current value of FROM_USER_NAME in each record.

A table field's Default Value property is not the appropriate place to calculate a value from another field in the same record. A query evaluates the expression against each row and avoids storing a calculated value unnecessarily.

1
Create a query

In Access, select Create > Query Design and add the table containing FROM_USER_NAME.

2
Add the expression

In an empty Field cell in the query design grid, enter: IsTacpk: IIf([FROM_USER_NAME]="tacpk", True, False). Replace True and False with your desired results if needed.

3
Run and check the query

Click Run and compare the IsTacpk results with the values in FROM_USER_NAME. Add FROM_USER_NAME to the grid if it is not already visible.

4
Remove the unsuitable default

If the table field no longer needs that default, open the table in Design View, select the field, and clear its Default Value property.

Calculate the IIf result in an Access query
Existing records: Changing a Default Value property does not recalculate values already stored in the table. The query provides a calculated result without changing those stored values.
Free Microsoft Office alternative

Work with Office documents and spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with Office documents, spreadsheets, and presentations. Its format compatibility makes it easy to move everyday files from Microsoft Office, though it does not fix Access database expressions.

Use spreadsheet formulas to calculate results from cell values.Open and edit Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTX.Navigate a familiar interface designed for everyday office work.Use a free, lightweight suite for common document tasks.
QA img-9

Frequently Asked Questions

Why does the table default value return False?

A table Default Value expression is not designed to reliably read another field in the current record. Calculate the comparison in a query using [FROM_USER_NAME] instead.

How do I show a label instead of True or False?

In the query design grid, enter an expression such as Result: IIf([FROM_USER_NAME]="tacpk", "Match", "No match"). Change the two labels to suit your needs.

What if the query still shows no match?

Add FROM_USER_NAME to the query results and inspect the stored value for extra spaces or other differences. Also confirm that the field name in the expression matches the table field.

Will changing the default update existing records?

No. The Default Value property applies when new records are created; changing it does not recalculate existing stored values. Use a query to display a current calculated result.