Is this a bug?

  • Thread starter Thread starter Stapes
  • Start date Start date
S

Stapes

I am modifying a report for a customer.
An anomaly has appeared
If I squash everything on to one page, everything is OK and all my
fields have values in 'em.
However, if I add a page break, or detail lines force a page break, all
my fields on the new page show either #name or #error.

Please help
 
Steve, you have a calculated control somewhere that has a problem.

Once Access finds a control is is unable to calculate, it gives up trying to
calculate the others. Therefore one bad one can affect many/all the others
(depending on the order Access tries to calculate them.)

There are lots of things you could be looking for, such as:

a) You are attempting to operate on a field that is not on the report.
If you have a text box with Control Source:
=Sum([Quantity])
but there is no Quantity on the report, Access may optimise the report so
that the Quantity is not fetched. To fix this problem, add a (hidden) text
box for the Quantity field.

b) You placed a control in the wrong section.
For example, if you put:
=Sum([Quantity])
in the Page Footer, it will error.

c) There is a control that has the same name as a field, but it is bound to
something else. For eample, this will error:
Control Source =Sum([Quantity])
Name Quantity

d) You referred to a control in a subreport that has no data.
Fix:
http://allenbrowne.com/casu-18.html

There's lots of other reasons, but the basic trouble-shooting technique is
to make a copy of the report, and start dropping out calculated controls.
When the problem goes away, you have identified which one was the cause, so
work on that one. Repeat the process until all controls work.
 
Hi
This project seems to be sinking deeper and deeper into the mire.
I get different results when I press the print button from the print
preview screen - i.e. the printout differs from what I am seeing on the
screen.
How do you cope with such uncontrollable software?

Stapes
 
Sounds like you have several bugs to sort out here.

If you are programmatically assigning values using module-level variables
(not recommended), you may need to reinitialize your variables in the Format
event of the Report Header.

Access is powerful enough that it's easy to get yourself into trouble and
create problems.
 
Hello Again
I am still struggling with this puzzler. When I use the print option,
the print out is correct and all the values are there. If I use the
preview option, it messes up. Any data that ends up on the next page
has #error or #name on it. The client originally built this
report/form/query. The Detail section has an event procedure that sets
a number of the reportfieldname.visible fields to false - to hide lines
where the amount shown is zero. I have tried skipping this entire
procedure & it makes no difference. I have also put a section in the
report header, setting all the .visible fields that may have been
altered back to true.
When it goes on to process the second page, it appears to run thru the
Detail On_Format event procedure again - but we don't really want it
to. So I have put a flag in to bypass it after the first page.
Still makes no difference.
The thing is - this bug appeared out of the blue. All was OK up until
mid afternoon the day before yesterday. I was inches away from
completing the project - and all the results looked good.

Despairing

Stapes
 
Hi Again
One more thing that might help diagnose my problem.
Data keeps getting repeated after the page breaks. i.e. the last 6 or 7
rows are printed again over the page

Stapes
 
There are several things that could be happening here, and it's not really
possible to diagnose in the newsgroups a report that has code in its events,
and programmatically shows/hides page breaks. Anything could be happening,
Steve.

If you can't pin it down, it might be just as easy to find out what the
report is supposed to be doing, and then create a report that does that
instead of trying to fix someone else's mistakes.
 
Hi Again
It's all very well saying I should do this instead of tring to fix
somebody elses mistakes, but this is my job. The client has obviously
been working with his system for many years. He says he has wanted this
new improvement that I am supposed to be doing for 10 years. As I said
earlier, the report is huge. It runs several reports & subreports to
get to this point, and runs the same report up to 4 times at once,
keeping carried forward totals from 1 period to the next.
I guess I'll just have to tell the client it cannot be done with
Microsoft Access.
Yours

Stapes
 
Hi Again
I fixed my problem.

I was using values from another report run first in the Code:

DoCmd.OpenReport "OverallReport", acViewPreview

Then running my report:

DoCmd.OpenReport strRepName, strFormatType

Then I was closing the first report:

DoCmd.Close acReport, "OverallReport"

This all worked fine with the 'Print' option. Using 'Preview' was a
different matter. The process seems to stop once it had displayed page
one of the report, but it appears to have closed "Overall Report" at
that time. Then, when I try to go to the next page, or press 'Print'
from the preview screen, I get garbage.

I removed the close statment, and everything now appears to be fine.

Yours,

Stapes
 
Back
Top