Control displays null value as zero (0)

M

Mike Collard

I have a control populated by a procedure that can produce
a null value. Under this circumstance I want the control
to be blank but it displays a zero.

How can I force the control to display nothing if the
value is null?

Mike Collard
 
N

nieurig

-----Original Message-----
I have a control populated by a procedure that can produce
a null value. Under this circumstance I want the control
to be blank but it displays a zero.

How can I force the control to display nothing if the
value is null?

Do you have tested the nz() function?
select nz([fieldname],"") from table

Good luck.
Niels
 
D

Dirk Goldgar

Mike Collard said:
I have a control populated by a procedure that can produce
a null value. Under this circumstance I want the control
to be blank but it displays a zero.

How can I force the control to display nothing if the
value is null?

Mike Collard

Displaying nothing for Null is the normal way for a control to behave.
Is it possible that the control has its Format property set to display 0
for Null? Post the control's Format property (from the control's
property sheet) if you aren't sure what it's doing.
 
M

Mike Collard

The controls format property is blank so I would assume a
null is displayed as null.

Have tried the Nz(,"") but no luck.

The control is a combo with two columns bound to column 1
and I want the value of column 1 displayed when a
selection is made. If the column width of column 1 is set
to greater than zero then 0 is displayed if no selection
has been made but if the column width of column 1 is set
to zero then null is displayed with no selection. This is
a partial solution but it means that when a selection is
made the value of column 2 is displayed.

Hope you can follow this.

Mike Collard
 
D

Dirk Goldgar

Mike Collard said:
The controls format property is blank so I would assume a
null is displayed as null.

Have tried the Nz(,"") but no luck.

The control is a combo with two columns bound to column 1
and I want the value of column 1 displayed when a
selection is made. If the column width of column 1 is set
to greater than zero then 0 is displayed if no selection
has been made but if the column width of column 1 is set
to zero then null is displayed with no selection. This is
a partial solution but it means that when a selection is
made the value of column 2 is displayed.

Hope you can follow this.

Mike Collard

Is it possible that you're seeing the default value of the field to
which the combo box is bound? Look in the table design of the form's
recordsource table, and check the Default Value of the field to which
the combo is bound. Maybe that is 0.
 

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