=Len(Nz(Me.txtAuthor, 0)) is returning 1 even when the field is blank !

M

Mark Kubicki

how come (?) when I enter the expression:

=Len(Nz(Me.txtAuthor, 0))
it returns the value 1 even when the field is blank !

much thanks, in advance, for any thought you may have
-m.
 
D

Dirk Goldgar

Mark Kubicki said:
how come (?) when I enter the expression:

=Len(Nz(Me.txtAuthor, 0))
it returns the value 1 even when the field is blank !


Yes, that would be correct. What you have written says, "If Me.txtAuthor is
Null, take the number 0, convert it to a string -- "0" -- and tell me the
length of that string. The result will be 1.

You may want this:

=Len(Nz(Me.txtAuthor, ""))

or this:

=Len(Me.txtAuthor & "")

.... which will accomplish the same thing.

Or you may want something else, if I've guessed wrong about what you intend
with this expression.
 

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