Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting crosstab query values in Report?? 1

Status
Not open for further replies.

sjh

Programmer
Oct 29, 2001
263
US
Hi,

I have a report which is based on a crosstab query. When I try to reformat the display style of a field, it prints out "#Error" on the report.

For example, I have a number field called [1]. And I set the Control Source to =[1]/1000

But this prints "#Error" on the report. What am I doing wrong???

Thank you for your help!
SJH
 
sjh
It appears to me that you are trying to do more than "reformat the display style"; you are trying to make some calculation based on the value of your field called [1]. My hunch is that you dragged the field onto the report and then tried to perform the calculation by putting the expression in the control source, but you can't do it that way.

If that is really what you want to do, then be sure you start with a fresh text box, and set the control source to
=[1]/1000

Having said that, do you really have a field called [1]? That just seems unusual, and it could lead to Access becoming confused between field names and values.

Tom

 
Thank you Tom!
Your hunch was right on target. I ended up modifying the query so that it returns the value in thousands.

And I do have a field called [1]. If this is a bad practice, I will change it.

Thanks again,
SJH
 
sjh
I did a bit of checking. The only thing I can find that would fully prohibit the use of a number as a field name (such as in your case where the field name is "1") would be if you wanted to transfer information back and forth to an Excel spreadsheet.

However, you would normally give a field a name that would, in some sense, describe the field, so that later on you could, just by looking at the field name, understand what it meant.
If you had 5 fields, and named them 1, 2, 3, 4 and 5, wouldn't that lead to confusion?

I, of course, don't know enough about your database to suggest anything more concrete. But I would tend to give fields a more descriptive name.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top