Microsoft Knowledge Base Email Alertz

(209098) - The AllowZeroLength property determines whether a zero-length string () is a valid entry. The Required property determines whether a Null value is a valid value. Although these two properties work together, the AllowZeroLength property overrides the...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 209098 - Last Review: July 15, 2004 - Revision: 1.2

ACC2000: Using the AllowZeroLength and Required Properties

This article was previously published under Q209098
Novice: Requires knowledge of the user interface on single-user computers.

This article applies only to a Microsoft Access database (.mdb).

SUMMARY

The AllowZeroLength property determines whether a zero-length string ("") is a valid entry. The Required property determines whether a Null value is a valid value. Although these two properties work together, the AllowZeroLength property overrides the Required property.

MORE INFORMATION

The AllowZeroLength property determines whether a zero-length string ("") is a valid entry, and is available only for Text and Memo fields. Microsoft Access supports both the Null value and zero-length strings in Text and Memo fields.

The Required property determines whether a Null value is a valid value. Although the AllowZeroLength and Required properties work together, the AllowZeroLength property overrides the Required property. For example, if AllowZeroLength is set to Yes, a zero-length string is a valid value for the field regardless of the Required property setting. To enter a zero-length string in a field, type two double quotation marks ("").

You can use the AllowZeroLength and Required property settings to differentiate between information that does not exist and information that may exist. For example, you may have employees in your database who do not have a home phone. If AllowZeroLength is set to Yes, Required is set to No, and DefaultValue is left blank for the HomePhone field, you can type two double quotation marks to indicate that an employee does not have a home phone. If you leave the field blank (do not type text or delete any existing text), it indicates that the employee may have a home phone but you do not know what it is.

The following table shows the results you can expect when you combine the AllowZeroLength and Required property settings:

AllowZeroLength    Required      User's action        Value displayed
 ---------------------------------------------------------------------

      No              No         Presses ENTER            <Null>
                                 Presses SPACEBAR         <Null>
                                 Types ""              (not allowed)



      Yes             No         Presses ENTER            <Null>
                                 Presses SPACEBAR         <Null>
                                 Types ""                   "" 



      No              Yes        Presses ENTER         (not allowed)
                                 Presses SPACEBAR      (not allowed)
                                 Types ""              (not allowed)



      Yes             Yes        Presses ENTER         (not allowed)
                                 Presses SPACEBAR           ""
                                 Types ""                   "" 
				

REFERENCES

For more information about the AllowZeroLength property, click Microsoft Access Help on the Help menu, type allowzerolength property in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

For more information about the Required property, click Microsoft Access Help on the Help menu, type required property in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

APPLIES TO
  • Microsoft Access 2000 Standard Edition
Keywords: 
kbhowto kbinfo KB209098
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate