Others

Fix an Overflow Error in a Nested Microsoft Access Query

Steve KSteve K Nov 14, 2026 868 views

Question details

Identify and fix a calculation that causes an overflow when a Microsoft Access query is used inside another query.

Fix an Overflow Error in a Nested Microsoft Access Query
Product
Microsoft Access
Device & OS
not provided
Scenario
A user references a calculated field from one Access query in a second query.
Observed behavior
The source query works independently, but the nested query produces an Overflow error or fails to display the calculated cost.
Before you start

Open both the source query and the query that references it in Access. Note the calculated field name, its expression, and the data types of the fields used in the calculation.

Solution 1Recommended

Isolate the expression that causes the overflow

Test the calculated field in smaller parts to find which operation fails when the query is nested.

1
Open the source query

In the Navigation Pane, right-click the source query and select Design View. Find the calculated field containing the nested IIf expression.

2
Test a simpler expression

In the calculated field's Field row, replace the full expression temporarily with one IIf expression or a single calculation. Select Run to check the result.

3
Add parts back one at a time

Return to Design View, add the next part of the expression, and select Run again. Repeat until you identify the part that triggers the error.

4
Check numeric ranges and inputs

Inspect the failing operation for values outside the result type's range, Null values, and zero divisors. Where appropriate, convert operands before arithmetic with a suitable function such as CDbl or CCur, then run both queries again.

Isolate the expression that causes the overflow
Check both IIf branches: Access evaluates both the true and false parts of IIf, so an invalid calculation can cause an error even when its branch is not the expected result.
Free Microsoft Office alternative

Work with exported query results in WPS Spreadsheets

WPS Office is a free, lightweight alternative for everyday office work, with a familiar interface and Microsoft Office format compatibility for easier migration. Export Access query results to Excel to review them in WPS Spreadsheets; WPS does not fix or run Access queries.

Review exported query results and calculations in WPS SpreadsheetsOpen and edit Microsoft Excel XLSX filesUse a familiar spreadsheet interfaceWork in a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does the source query work but the nested query overflow?

The outer query may evaluate or combine the calculated expression differently or process values that expose an overflow. Open both queries in Design View and test the calculation in smaller parts to isolate the cause.

Can IIf cause an error in a branch that is not selected?

Yes. Access evaluates both the true and false parts of IIf. Check both branches for invalid conversions, zero divisors, and calculations that exceed the numeric type's range.

How can I check the data types used by the calculation?

Open the source tables in Design View and inspect the Data Type and Field Size properties of the fields used in the query. Also review conversions and arithmetic in the query's calculated Field row.

Can WPS Office repair an Access query?

No. Troubleshoot the query in Microsoft Access. You can export query results to an Excel file and open that file in WPS Spreadsheets for review.