Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to HasValue    Comments List
Pinned    Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Summary
Richard Rost 
          
3 years ago
Simplifying Null and Empty String Checks in Microsoft Access with a Custom Function

When working with databases, especially in Microsoft Access, distinguishing between a null value and an empty string is a routine yet often perplexing task. This distinction becomes crucial when developing a database application, as it ensures data integrity and validates user input accurately.

In Microsoft Access, when a value in a short text field is deleted by a user, it becomes null, whereas if a value in a long text field is deleted, it turns into an empty string. This behavior difference can add complexity to your code when you need to check the state of these fields before proceeding with other operations.

A practical approach to simplify this task is by creating a custom function named `hasValue`. This function checks the state of a text field and returns a boolean value indicating whether the field has a value or not. It treats both null and empty string states as having no value, thus returning False, and if there's any other value, it returns True.

By calling the `hasValue` function, you can easily check if a text field is null or empty, which simplifies your code and enhances its readability. This function is a prime example of how creating custom functions can significantly streamline your coding process in Microsoft Access.

For a step-by-step guide on creating the `hasValue` function, including more demonstrations, check out the full video tutorial available on my website and YouTube channel. If you enjoy learning VBA and want to deepen your understanding of Microsoft Access, explore more lessons online or download the free template to follow along.

Richard Rost
Live long and prosper.

P.S. To watch a complete video tutorial covering the topic of today's article, visit https://599cd.com/HasValue

This thread is now CLOSED. If you wish to comment, start a NEW discussion in HasValue.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/9/2026 2:42:01 PM. PLT: 1s