How to Enter "" in Text Field

  • Thread starter Thread starter Larry Bohen
  • Start date Start date
L

Larry Bohen

Currently when I enter "" (with zero-length strings allowed) into a text
field in Access 2003 and leave the field, the "" disappears. I think it
turns it into a null value. How can I get the "" to continue to show in the
field?
 
Hi Larry,

When you enter "" into a field (with zero-length strings
allowed), you get a zero length string (ZLS). A ZLS is NOT
the same as null. You can prove this to yourself by
running a query, and setting the criteria for this field
to either Null or "".

Null means that a value is unknown. ZLS is used when you
know that a value does not exist. For example, if a
customer does not have a facsimile machine, a ZLS entry
means "I know that this customer doesn't have a fax
machine". On the other hand, a null in this field would
mean "I don't know if this customer has a fax machine".

To the best of my knowledge, you cannot enter "" into the
display. I'm not sure why you would want to.

Tom
____________________________________

Currently when I enter "" (with zero-length strings
allowed) into a text field in Access 2003 and leave the
field, the "" disappears. I think it turns it into a null
value. How can I get the "" to continue to show in the
field?
 
Hi Larry

Van and Tom answered your question by explaining the difference between a
zero-length string (ZLS) and a null.

This reply is just in case you did understand the difference and you were
actually asking:
How can I make a zero-length string (ZLS) display as "", in order to
visually distinguish it from a Null?

If that's the question, Access cannot do it AFAIK.

You can set the Format property of the text box to:
&;\"\"
but Access displays the "" in the ZLS fields *and* the Null fields as "", so
it does not display the distinction you desire.

This again confirms the fact that the ZLS is not a very useful value to
store, and generally causes more problems that it is worth. Not only is
there no visible difference to the user, but Access itself gets confused
between the ZLS and Null, i.e. DLookup() wrongly returns Null when a field
contains a ZLS.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top