Access 2007-2019
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
Home > TechHelp > Directory > Access > NZ < AfterUpdate | For Next >
NZ Function
By Richard Rost   Richard Rost on Twitter Richard Rost on LinkedIn Email Richard Rost   2 years ago

Use the NZ Function to Convert NULL to Zero

 S  M  L  XL  FS  Join Now

In this Microsoft Access tutorial, I'll show you how to use the NZ function to change NULL values into ZERO, or any other value that you want. 

Bill asks: "In my form, I have to add two values together to get a total time an employee worked on a project. I have the default value set to zero, but if they somehow delete the value it messes up my calculations. Is there any way to stop this?"


I'll show you how to set the default country to "United States" if the customer doesn’t have a country specified. If the customer doesn’t have a start date, use NZ to set it equal to today so they don’t get a gift card reserved for long-time customers. If a customer doesn’t have any orders in the database, use a LEFT JOIN to show them in a query and then NZ to set their order total to $0. Check to see if a customer's email address exists in the database. If so, warn before adding. Use NZ to make DLookup not error out.

Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the database template from class plus get access to the Code Vault. If you signed up on YouTube you have to contact me so I can set up your account here on my web site. If you're not a member, Join Today!


Customer Database Template

Learn More

FREE Access Beginner Level 1
Access Level 2 for $1.00

Free Templates

TechHelp Free Templates
Blank Template
Contact Management
Order Entry & Invoicing
More Access Templates


Mailing List - Get Emails When New Videos Released!
Consulting - Need Help with Your Database?


Please feel free to post your questions or comments below or submit them via the TechHelp page.


NZ Function DLookup Upload Images   Link  
Elisabeth Koivumaa 
3 months ago
I have searched here on the website but not found a good answer.

I watched the movie about the NZ feature. But I do not understand how to get it with dlook up. Want to get rid of the #error text in my continuous form. Read More...
Richard Rost
3 months ago
I'm assuming you MEANT to misspell "Producct"

Wrap your CRITERIA in the NZ function:

=DSlUpp("Description";"Qry_Bestllnings_frga";"ProducctID=" & NZ([producctid],0))

Also not sure what "DSlUpp" means. But I would do:

=DLOOKUP("Description","MyTableT","ID=" & NZ(ID,0))
Elisabeth Koivumaa
3 months ago
I code in Swedish and this forum does not take Swedish letters. But it should be dlookup in English. But then I have to write with a semicolon instead of commas. Otherwise it will be the wrong message.
Add a Reply
Customer Since NULL Upload Images   Link  
Matt Pattison 
11 months ago
if CustomerSince Isnull could you put the date of the 1st order they placed or 1st order paid?

Richard Rost
11 months ago
Sure. All depends on when and how you want to get that value. In a query, you could use IIF to determine if it's NULL and if so, DMIN their first order date. :)
Add a Reply

Start a NEW Conversation
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.

You may want to read these articles from the 599CD News:

1/18/2022Access B2 Upgrade
1/17/2022Access Beginner 2 Links
1/17/2022Access Beginner 2
1/17/2022New Record on Top
1/13/2022Missing References
1/13/2022Access Beginner 1 Links
1/11/2022Access Fast Tips
1/11/2022System Defaults
1/10/2022Multi Select List Box

Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
My Account
My Courses
Lost Password
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Customer Support
Web Site Tour
Consulting Services
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Contact Info
Support Policy
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn
Keywords: TechHelp Access NZ Null Zero Exists null to zero nz function  PermaLink