You can use the format property to display a "0". Check help for Format Property - Numeric. A sample format property that would display "0" for Null:
0.00;(0.00);0.00;0
Duane
MS Access MVP
Find out how to get great answers faq219-2884.
(a) In the field definition, ensure that the DefaultValue property is set to zero. Also set the Required property to Yes. This will prevent Null entries from being allowed for the field for new or changed records.
(b) You could also use the BeforeUpdate event of the form to test the value and convert it to zero if it is null; eg. as provided in the post above:
YourField = nz(YourField,0)
This would ensure that your user interface automatically did the conversion without having to prompt the user to do it; though in most cases, the zero default would prevent the message anyway (unless the user changed the value to null).
There are other options, but these ought to suffice.
Hope this helps,
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.