I have a Grid on a form where the column is using the 'Z' format meaning
that for numeric values, if the value is 0 then the column is displayed
as a blank. Recently a requirement has emerged whereby a value of zero
is a legitimate value in the grid.

The problem is that I want to be able to display a zero value when there
is a zero result but a blank value when no previous value has been
entered.

Is that possible?

I am using VFP 7



thanks

pete

Re: Grid - Zero values by Paul

Paul
Thu Feb 14 21:07:04 CST 2008

This may not be elegant, but you could keep a "not entered" value of null in
the column, with nulldisplay = "".

Or perhaps better, add a boolean column that contains .T. if someone has
entered a value, and base display of the numeric column on that value.



"Peter Huish" <huish@ozemail.com.au> wrote in message
news:MPG.221f7be055ea67769896e7@news.easynews.com...
>
> I have a Grid on a form where the column is using the 'Z' format meaning
> that for numeric values, if the value is 0 then the column is displayed
> as a blank. Recently a requirement has emerged whereby a value of zero
> is a legitimate value in the grid.
>
> The problem is that I want to be able to display a zero value when there
> is a zero result but a blank value when no previous value has been
> entered.
>
> Is that possible?
>
> I am using VFP 7
>
>
>
> thanks
>
> pete



Re: Grid - Zero values by Fred

Fred
Thu Feb 14 23:15:46 CST 2008

You could do it by adding another TextBox control to the grid.column and
using the column.DynamicCurrentControl.

1) Add the additional TextBox to the column
1a) Select the column with mouse
1b) Select the textbox from the Form controls menu
1c) Select the title bar of the form/class designer with the mouse
1d) Click the mouse in the column

You should now have two textboxes in the column, text1 and text2

2) Set the text2.Format=Z

3) Set the
Column.DynamicCurrentControl=IIF(ISBLANK(table.field),"text2","text1")


That should be all you need to add.

--
Fred
Microsoft Visual FoxPro MVP


"Peter Huish" <huish@ozemail.com.au> wrote in message
news:MPG.221f7be055ea67769896e7@news.easynews.com...
>
> I have a Grid on a form where the column is using the 'Z' format meaning
> that for numeric values, if the value is 0 then the column is displayed
> as a blank. Recently a requirement has emerged whereby a value of zero
> is a legitimate value in the grid.
>
> The problem is that I want to be able to display a zero value when there
> is a zero result but a blank value when no previous value has been
> entered.
>
> Is that possible?
>
> I am using VFP 7
>
>
>
> thanks
>
> pete



Re: Grid - Zero values by Anders

Anders
Fri Feb 15 04:03:45 CST 2008

That's what NULL is for.

-Anders

"Peter Huish" <huish@ozemail.com.au> wrote in message
news:MPG.221f7be055ea67769896e7@news.easynews.com...
>
> I have a Grid on a form where the column is using the 'Z' format meaning
> that for numeric values, if the value is 0 then the column is displayed
> as a blank. Recently a requirement has emerged whereby a value of zero
> is a legitimate value in the grid.
>
> The problem is that I want to be able to display a zero value when there
> is a zero result but a blank value when no previous value has been
> entered.
>
> Is that possible?
>
> I am using VFP 7
>
>
>
> thanks
>
> pete



Re: Grid - Zero values by tim_witort

tim_witort
Wed Feb 20 00:22:47 CST 2008

Peter Huish seemed to utter in news:MPG.221f7be055ea67769896e7
@news.easynews.com:

>
> I have a Grid on a form where the column is using the 'Z' format meaning
> that for numeric values, if the value is 0 then the column is displayed
> as a blank. Recently a requirement has emerged whereby a value of zero
> is a legitimate value in the grid.
>
> The problem is that I want to be able to display a zero value when there
> is a zero result but a blank value when no previous value has been
> entered.
>
> Is that possible?
>
> I am using VFP 7

As others have stated, NULL will likely do what you want,
but if you're not accustomed to working with NULLs, it
might be problematic. And if you're not using DBCs, you'll
need to switch to DBC data storage.

Another option is to use a text field rather than numeric.
These can handle zeros, spaces, and numbers nicely. Then
you would convert the text to numeric if/when calculations
need to be done using that field.

Your application requirements will determine which
approach is easier.

-- TRW
_______________________________________
t i m . w i t o r t
_______________________________________