Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"0" is not equal to " "

Status
Not open for further replies.

JackONeill

Programmer
Mar 8, 2004
65
US
hello

i do some query on a database using access

but when there is no data the field remains white...

is there a way to automaticly set the value to "0"

and not blank?

Tk!
 
JackONeill

It depends, and this what you really want?

If you have a string field, the default should not really be 0. In fact, it is usually better to have a null value.

Regardless, you can set the default value for a field in the table design. Likewise, using the property window, you can set the default for fields on the form.
 
In your query, instead of putting the name of the field, use the Nz() function:

Nz([YourFieldName],0)

This will return 0 for all instances of null.

-Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top