Null data in table

  • Thread starter free.teranews.com
  • Start date
F

free.teranews.com

I have a table with 'Village' and 'PostTown' columns.
I have a Query which calls a simple function to output Village if specified
or PostTown otherwise.
This works fine providing Village conatains a character. If it is blank I
get #ERROR before the funcion is reached. Even if the function contains no
code the error is generated.
Help would be much appreciated. Thank you.
Geoff
 
K

Ken Snell

Use the Nz function to change Null values of the field to something else
before you send the value to the function. Or change the function (if you
wrote it) to test for Null values and handle them correctly.

Nz([NameOfField], 0)
 
H

hansford cornett

-----Original Message-----
I have a table with 'Village' and 'PostTown' columns.
I have a Query which calls a simple function to output Village if specified
or PostTown otherwise.
This works fine providing Village conatains a character. If it is blank I
get #ERROR before the funcion is reached. Even if the function contains no
code the error is generated.
Help would be much appreciated. Thank you.
Geoff



.
I am not sure however I think if you use the NZ(Field,0)
feature to set null to 0 and then test based on if it is
zero or not you may solve your problem....

Please respond to the newsgroup so all can see...

Hansford
 
P

Pavel Romashkin

Pass your Village field as Nz(Village, "None") and check for "None" in
your function.

Cheers,
Pavel
 
F

free.teranews.com

Thank you all so much
Avillage: (IIf(Nz([village],"")="",[posttown],[village]))
did the job and I didn't even need to call a separate function.
It's easy when you know what you are doing, but I so often don't!
Geoff
 

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