help with null values

octatyan

Registered User.
Local time
Today, 07:51
Joined
Jan 10, 2003
Messages
36
Hi, I have a form that displays a person's name and their account balance.

But not all people have an account (so their balance is null).

How do I make the text field so a zero if the data is a null value?

I guess I would need to insert some vb code??? but how would I write the code and where would I place the code?

thanks
 
1) If the field is for a balance ... I would think the datatype should be currency and not text.
So if the datatype was numeric or currency you would set the Default Value to be 0 .. and the problem would not exist.

2) Usually a "balance" is the result of a calculation.
The result of a calculation should not be a stored value in a database .... it should be calculated "dynamically" when the value is needed.

3) To force a value to 0 (zero) if the return is Null .. use the Nz() function.

Example as the Control Souce of a txtbox on a form/report:
=Nz([YourFieldName], 0)

HTH
RDH
 
Last edited:

Users who are viewing this thread

Back
Top Bottom