formatting when using NZ

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query with the following:
CurrProduction: Nz([CurrentProduction],0)

When I use CurrProduction as the control souce in my report, I can't format
CurrProduction as Standard. The drop down for fomatting in the properties is
blank.

If I use =[CurrProduction]+0 for the control source then the drop down shows
all the formatting and I can select Standard.

I don't like using this work around. Why is this happening and is there
another "fix" for this?
 
I went to the link and read the information about wrapping the calculation.
I tried:
CurrProduction: Cdec(Nz([CurrentProduction],0)) and I keep getting an error
message. It states that I am using the wrong number of arguments.

I don't see that this is the case. What am I doing wrong??

Thanks!

Allen Browne said:
See:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

The article explains how to typecast the query field so that Access
understands it is a number. It will then offer the formatting for numbers
in your report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Baffee said:
I have a query with the following:
CurrProduction: Nz([CurrentProduction],0)

When I use CurrProduction as the control souce in my report, I can't
format
CurrProduction as Standard. The drop down for fomatting in the properties
is
blank.

If I use =[CurrProduction]+0 for the control source then the drop down
shows
all the formatting and I can select Standard.

I don't like using this work around. Why is this happening and is there
another "fix" for this?
 
Try:
CDbl(Nz([CurrentProduction],0))

If that still fails, tell us more about the CurrentProduction field. Is it a
field in your table? If so, open the table in design view, and tell us the
Data Type (middle column) and Field Size (lower pane of table design) of
this field.

Or is it also a calculated query field that could be misunderstood? Or
perhaps a linked table from a non-JET (non-Access database) source?

Mention your version of Access as well.

The reason I suggested you avoid CDec() is that Access has no idea how to
perform even basic operations with this data type:
http://allenbrowne.com/bug-08.html
and Access 97 and earlier have other problems with it as well.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Baffee said:
I went to the link and read the information about wrapping the calculation.
I tried:
CurrProduction: Cdec(Nz([CurrentProduction],0)) and I keep getting an
error
message. It states that I am using the wrong number of arguments.

I don't see that this is the case. What am I doing wrong??

Thanks!

Allen Browne said:
See:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

The article explains how to typecast the query field so that Access
understands it is a number. It will then offer the formatting for
numbers
in your report.

Baffee said:
I have a query with the following:
CurrProduction: Nz([CurrentProduction],0)

When I use CurrProduction as the control souce in my report, I can't
format
CurrProduction as Standard. The drop down for fomatting in the
properties
is
blank.

If I use =[CurrProduction]+0 for the control source then the drop down
shows
all the formatting and I can select Standard.

I don't like using this work around. Why is this happening and is
there
another "fix" for this?
 
That worked GREAT...Thanks for all your help!

Allen Browne said:
Try:
CDbl(Nz([CurrentProduction],0))

If that still fails, tell us more about the CurrentProduction field. Is it a
field in your table? If so, open the table in design view, and tell us the
Data Type (middle column) and Field Size (lower pane of table design) of
this field.

Or is it also a calculated query field that could be misunderstood? Or
perhaps a linked table from a non-JET (non-Access database) source?

Mention your version of Access as well.

The reason I suggested you avoid CDec() is that Access has no idea how to
perform even basic operations with this data type:
http://allenbrowne.com/bug-08.html
and Access 97 and earlier have other problems with it as well.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Baffee said:
I went to the link and read the information about wrapping the calculation.
I tried:
CurrProduction: Cdec(Nz([CurrentProduction],0)) and I keep getting an
error
message. It states that I am using the wrong number of arguments.

I don't see that this is the case. What am I doing wrong??

Thanks!

Allen Browne said:
See:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

The article explains how to typecast the query field so that Access
understands it is a number. It will then offer the formatting for
numbers
in your report.

I have a query with the following:
CurrProduction: Nz([CurrentProduction],0)

When I use CurrProduction as the control souce in my report, I can't
format
CurrProduction as Standard. The drop down for fomatting in the
properties
is
blank.

If I use =[CurrProduction]+0 for the control source then the drop down
shows
all the formatting and I can select Standard.

I don't like using this work around. Why is this happening and is
there
another "fix" for this?
 
Back
Top