How to Concatenate Access Fields Correctly When Values Are Null
Question details
The user needs to construct an expression to correctly concatenate string fields in Microsoft Access without producing unexpected results or formatting issues when some of the field values are Null.
- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Writing concatenation expressions (like joining first name, spouse name, and last name) where intermediate fields might be Null rather than simply empty.
- Observed behavior
- Direct string comparison or concatenation behaves inconsistently because Access treats Null values differently from zero-length (empty) strings.
Ensure you know which fields in your Access table are allowed to be Null, and understand the difference between a Null value (no data entered) and a zero-length string (an explicitly blank text value).
Use the Nz() Function in Expressions
The Nz() function safely converts Null values to zero-length strings, allowing conditional logic and concatenation to work predictably.
In Microsoft Access, a Null value represents missing or unknown data. If you use standard comparison operators (like <> "") directly on a Null value, the result is not guaranteed to behave the same as a zero-length string. Wrapping the field in the Nz() function ensures that if a Null is encountered, it is treated as a standard empty string.
Open your Microsoft Access database, navigate to the Queries section, and open your target query in Design View.
In a blank column's Field row, enter your concatenation expression using IIf and Nz. For example: Donor: IIf(Nz([Spouse],"")<>"",[FirstName] & " " & [Spouse] & " " & [LastName],[FirstName] & " " & [LastName])
Click the 'Run' button on the Ribbon. Check the results to ensure that records with Null Spouse fields are concatenated properly without leaving extra blank spaces.
Create a Custom VBA Concatenation Function
For databases with complex fields or multiple optional parameters, writing a custom VBA module offers a cleaner and more scalable approach.
Manage Data Easily with WPS Office
While Microsoft Access is a powerful tool for complex relational databases, many data tracking, concatenation, and sorting tasks are easier to manage in a spreadsheet environment. WPS Office provides a lightweight, highly compatible alternative to Microsoft Office, featuring a powerful spreadsheet application equipped with modern text functions.
- 1. Download the software: Visit the official WPS website and download the free WPS Office installation package.
- 2. Install and launch: Run the installer, follow the on-screen prompts, and launch WPS Spreadsheet.
- 3. Use TEXTJOIN for easy concatenation: Use the TEXTJOIN function to combine data. By setting the 'ignore_empty' argument to TRUE, WPS Spreadsheet automatically bypasses empty cells without complex IF statements.

Frequently Asked Questions
Why does concatenating a Null value with a string return a Null result?
In Microsoft Access, if you use the standard '+' operator for concatenation, a Null value will propagate, turning the entire resulting string into Null. Using the '&' operator is safer because it generally treats Null as an empty string, though conditional statements still require explicit Null handling.
What is the difference between Null and a zero-length string in Access?
A Null value indicates that the data is completely unknown or missing, while a zero-length string ("") indicates that the field is known to be blank. Access treats these two states differently in mathematical expressions and comparisons.
Can I use the IsNull() function instead of Nz()?
Yes, you can use IsNull() within an IIf statement (e.g., IIf(IsNull([Spouse]), ...)), but Nz() is often preferred because it is more concise. Nz() directly checks for Null and substitutes it with a zero-length string or another specified value in a single step.




