From: Tony Williams on
I am trying to unravel a report that someone has created (and since left)
and am getting an error in a calculated control.
In one control there is this expression

Round([txtprevqtrtotal8],0)

and in another is this

Round(Nz([txtprevqtrtotal9],0),0)

The first one works ok but the second one shows #Error I'm trying to figure
out why they would have inserted the Nz expression and what does it do. I've
searched help but can only find info on Nz in Visual Basic which doesn't
help me.

Can anyone help?
Thanks
Tony






From: Klatuu on
If txtprevqtrtotal8 is null,
Round([txtprevqtrtotal8],0)
Will return Null
If txtprevqtrtotal9 is null,
Round(Nz([txtprevqtrtotal9],0),0)
Will return 0

Both expressions are valid.
I do notice a difference in the name. Is the name difference correct?
are the names the name of controls or recordset fields?
Are both preceded by =

--
Dave Hargis, Microsoft Access MVP


"Tony Williams" wrote:

> I am trying to unravel a report that someone has created (and since left)
> and am getting an error in a calculated control.
> In one control there is this expression
>
> Round([txtprevqtrtotal8],0)
>
> and in another is this
>
> Round(Nz([txtprevqtrtotal9],0),0)
>
> The first one works ok but the second one shows #Error I'm trying to figure
> out why they would have inserted the Nz expression and what does it do. I've
> searched help but can only find info on Nz in Visual Basic which doesn't
> help me.
>
> Can anyone help?
> Thanks
> Tony
>
>
>
>
>
>
>
From: Tony Williams on
Hi Thanks Dave
Yes the names are correct. I couldn't understand why one expression had Nz
and the other didn't. I want the expression to
return 0 or a number so I'll change the other to include the Nz as
presumably if I then try and add the expressions without the Nzo will the
Null value cause problems?
Thanks again.
Tony
"Klatuu" <Klatuu(a)discussions.microsoft.com> wrote in message
news:7C364210-F58D-4012-8A3F-C44B951D2A81(a)microsoft.com...
> If txtprevqtrtotal8 is null,
> Round([txtprevqtrtotal8],0)
> Will return Null
> If txtprevqtrtotal9 is null,
> Round(Nz([txtprevqtrtotal9],0),0)
> Will return 0
>
> Both expressions are valid.
> I do notice a difference in the name. Is the name difference correct?
> are the names the name of controls or recordset fields?
> Are both preceded by =
>
> --
> Dave Hargis, Microsoft Access MVP
>
>
> "Tony Williams" wrote:
>
>> I am trying to unravel a report that someone has created (and since left)
>> and am getting an error in a calculated control.
>> In one control there is this expression
>>
>> Round([txtprevqtrtotal8],0)
>>
>> and in another is this
>>
>> Round(Nz([txtprevqtrtotal9],0),0)
>>
>> The first one works ok but the second one shows #Error I'm trying to
>> figure
>> out why they would have inserted the Nz expression and what does it do.
>> I've
>> searched help but can only find info on Nz in Visual Basic which doesn't
>> help me.
>>
>> Can anyone help?
>> Thanks
>> Tony
>>
>>
>>
>>
>>
>>
>>


From: Klatuu on
The Nz should not cause a problem. All it does is replace a Null value in
the first argument with the value of the second argument. If the value of
the first argument is not Null, it returns that value.
--
Dave Hargis, Microsoft Access MVP


"Tony Williams" wrote:

> Hi Thanks Dave
> Yes the names are correct. I couldn't understand why one expression had Nz
> and the other didn't. I want the expression to
> return 0 or a number so I'll change the other to include the Nz as
> presumably if I then try and add the expressions without the Nzo will the
> Null value cause problems?
> Thanks again.
> Tony
> "Klatuu" <Klatuu(a)discussions.microsoft.com> wrote in message
> news:7C364210-F58D-4012-8A3F-C44B951D2A81(a)microsoft.com...
> > If txtprevqtrtotal8 is null,
> > Round([txtprevqtrtotal8],0)
> > Will return Null
> > If txtprevqtrtotal9 is null,
> > Round(Nz([txtprevqtrtotal9],0),0)
> > Will return 0
> >
> > Both expressions are valid.
> > I do notice a difference in the name. Is the name difference correct?
> > are the names the name of controls or recordset fields?
> > Are both preceded by =
> >
> > --
> > Dave Hargis, Microsoft Access MVP
> >
> >
> > "Tony Williams" wrote:
> >
> >> I am trying to unravel a report that someone has created (and since left)
> >> and am getting an error in a calculated control.
> >> In one control there is this expression
> >>
> >> Round([txtprevqtrtotal8],0)
> >>
> >> and in another is this
> >>
> >> Round(Nz([txtprevqtrtotal9],0),0)
> >>
> >> The first one works ok but the second one shows #Error I'm trying to
> >> figure
> >> out why they would have inserted the Nz expression and what does it do.
> >> I've
> >> searched help but can only find info on Nz in Visual Basic which doesn't
> >> help me.
> >>
> >> Can anyone help?
> >> Thanks
> >> Tony
> >>
> >>
> >>
> >>
> >>
> >>
> >>
>
>
>
From: Tony Williams on
Thanks Dave
Tony
"Klatuu" <Klatuu(a)discussions.microsoft.com> wrote in message
news:2062C2CB-87CC-46BC-AA1D-6B84473B1056(a)microsoft.com...
> The Nz should not cause a problem. All it does is replace a Null value in
> the first argument with the value of the second argument. If the value of
> the first argument is not Null, it returns that value.
> --
> Dave Hargis, Microsoft Access MVP
>
>
> "Tony Williams" wrote:
>
>> Hi Thanks Dave
>> Yes the names are correct. I couldn't understand why one expression had
>> Nz
>> and the other didn't. I want the expression to
>> return 0 or a number so I'll change the other to include the Nz as
>> presumably if I then try and add the expressions without the Nzo will the
>> Null value cause problems?
>> Thanks again.
>> Tony
>> "Klatuu" <Klatuu(a)discussions.microsoft.com> wrote in message
>> news:7C364210-F58D-4012-8A3F-C44B951D2A81(a)microsoft.com...
>> > If txtprevqtrtotal8 is null,
>> > Round([txtprevqtrtotal8],0)
>> > Will return Null
>> > If txtprevqtrtotal9 is null,
>> > Round(Nz([txtprevqtrtotal9],0),0)
>> > Will return 0
>> >
>> > Both expressions are valid.
>> > I do notice a difference in the name. Is the name difference correct?
>> > are the names the name of controls or recordset fields?
>> > Are both preceded by =
>> >
>> > --
>> > Dave Hargis, Microsoft Access MVP
>> >
>> >
>> > "Tony Williams" wrote:
>> >
>> >> I am trying to unravel a report that someone has created (and since
>> >> left)
>> >> and am getting an error in a calculated control.
>> >> In one control there is this expression
>> >>
>> >> Round([txtprevqtrtotal8],0)
>> >>
>> >> and in another is this
>> >>
>> >> Round(Nz([txtprevqtrtotal9],0),0)
>> >>
>> >> The first one works ok but the second one shows #Error I'm trying to
>> >> figure
>> >> out why they would have inserted the Nz expression and what does it
>> >> do.
>> >> I've
>> >> searched help but can only find info on Nz in Visual Basic which
>> >> doesn't
>> >> help me.
>> >>
>> >> Can anyone help?
>> >> Thanks
>> >> Tony
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>>
>>
>>