Null data in table

  • Thread starter Thread starter free.teranews.com
  • Start date 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
 
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)
 
-----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
 
Pass your Village field as Nz(Village, "None") and check for "None" in
your function.

Cheers,
Pavel
 
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
 
Back
Top