Null vs empty string

L

LAS

I have an unbound form where one text box is loaded with the
tblCodes.Description value where one set of tblCodes.Code and
tblCodes.Code_group obtains. And the other is loaded with the
tblCodes.Description value where a different set obtains. In other words,
each text box is filled with the same kind of data. When I highlight the
text box and press the Delete key, one of the text boxes ends up with a null
and the other ends up with an empty string. I can't find anything in the
property lists that seems to control this. Why do they behave differently?

TIA
LAS
 
J

John Spencer

I would expect that one field allows zero-length strings and the other does
not. The allow zero length string property is a field property in a table.

As far as I know textbox controls do not have this property.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
L

LAS

They are unbound fields, but the values that are loaded into them with Set =
are from the same field (description) in the tblCodes table. That field
does allow zero length strings.
 
D

David W. Fenton

I have an unbound form where one text box is loaded with the
tblCodes.Description value where one set of tblCodes.Code and
tblCodes.Code_group obtains. And the other is loaded with the
tblCodes.Description value where a different set obtains. In
other words, each text box is filled with the same kind of data.
When I highlight the text box and press the Delete key, one of the
text boxes ends up with a null and the other ends up with an empty
string. I can't find anything in the property lists that seems to
control this. Why do they behave differently?

Description is a reserved word and I'd avoid using it as a field
name. I doubt that's the cause of the inconsistency, but I'd fix
that before I wasted any time on other troubleshooting tasks.

Are the underlying fields set to disallow zero-length strings? They
should be.
 
L

LAS

It doesn't come into it, because

1) It's not a bound field.

2) Both fields get their data from the description column.
 
D

David W. Fenton

2) Both fields get their data from the description column.

Does reversing the order change it?

Frankly, I have very little interest in a problem like this, since
if you were doing things properly (i.e., disallowing ZLS) you
wouldn't be *able* to encounter it.

There is simply no justification for allowing ZLS in 99% of cases. I
see it as just lazy design (i.e., making your table design less
robust in order to save processing data to insure it doesn't include
ZLS's).
 
L

LAS

What are ZLSs?

David W. Fenton said:
Does reversing the order change it?

Frankly, I have very little interest in a problem like this, since
if you were doing things properly (i.e., disallowing ZLS) you
wouldn't be *able* to encounter it.

There is simply no justification for allowing ZLS in 99% of cases. I
see it as just lazy design (i.e., making your table design less
robust in order to save processing data to insure it doesn't include
ZLS's).
 

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

Top