Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Zero Length    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Zls Vs Space
Rolf Widmer 
     
2 months ago
Hi there

Can Access distinguish between a Zero Length String ("") and a Space (Ascii key 32)?

Many thanks in advance for your answers.

Greets
Rolf
Donald Blackwell  @Reply  
        
2 months ago
A simple verification - create a form, put a button on it. In the click event, put:
Private Sub MyBtn_Click()

     msgbox ("" = " ")

End Sub
Richard Rost  @Reply  
          
2 months ago
A zero-length string is just that. It's a string with nothing in it. Whereas a space is a string with one character in it. That's a space character, which is ASCII 32. And neither of those things are equal to NULL, which is no value. A zero-length string says "I know what the value is; it's blank", whereas null says "I don't know what the value is."

See: Zero Length
Donald Blackwell  @Reply  
        
2 months ago
Ugh, sorry, video must not of registered when I tried to add it.  Was on way out door for doc appointment and didn't verify
Richard Rost  @Reply  
          
2 months ago
I will talk about this in Friday's Quick Queries video: 599cd.com/QQ81
Rolf Widmer OP  @Reply  
     
2 months ago
Hello Donald, hello Richard

Thanks for your rapid answers.
My problem is not about understanding Null Value etc. Thanks to the excellent!!! courses of Richard this is clear for me.

My question is:
There is a field "Value" that may contain a Null Value, a ZLS or a space.
The aim is to show by conditional formatting what kind of value it is.
To check this I have made database. The conditional formatting does not work for ZLS and space, the result is the same as for Null Value.
See picture attached.

Thanks again for your help.

Rolf
Rolf Widmer OP  @Reply  
     
2 months ago

Rolf Widmer OP  @Reply  
     
2 months ago
BTW. I am aware that Access is a "Space killer".
Donald Blackwell  @Reply  
        
2 months ago
I got received similar results to your test when I tried just using native Access functions (simple comparison, strcomp as text, strcomp as binary, etc). I'm sure there is probably a better way to test, however, I got expected results by creating some simple VBA Functions to do the test there and using the function call in the conditional formatting.

DetailsPublic Function CheckNull() As Boolean
    
    CheckNull = False
    If IsNull(Text0) Then CheckNull = True

End Function

Public Function CheckBlank() As Boolean
    
    CheckBlank = False
    If Text0 = "" Then CheckBlank = True

End Function

Public Function CheckSpace() As Boolean
    
    CheckSpace = False
    If Text0 = Chr(32) Then CheckSpace = True

End Function


Then for the Conditional Formatting rules, just:

Expression Is: CheckNull() = True
Expression Is: CheckBlank() = True
Expression Is: CheckSpace() = True

It didn't matter which order I put the Conditional Rules in, they all worked as expected
Rolf Widmer OP  @Reply  
     
38 days ago
Thanks a lot for your help, Donald. Sorry for not answering faster. I was busy with something else.
CheckNull() and CheckBlank() work well, but CheckSpace() does not. Don't pass your time for this anymore. For me it is not absolutely necessary, but just "Nice to have".
Greetings
Rolf

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

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: 4/30/2026 3:09:31 PM. PLT: 1s