footer appearing when it shouldn't in Microsoft Access Reports

R

rknowles

I have created a grouping on a single field in a table. I have set
"Group Footer" to "Yes" so a footer will appear, if there is any data
in the field. There is only one control in the footer, and that is an
image control. So, if the field has data (which will be the path to an
image file) then the footer is shown, and I load the image control with
the image pointed to by the path, and everything is great.
My problem is that, in some cases, the footer is shown when there is no
data in the field. The image control is shown, but no image is loaded.
I have "Force New Page Before Section" set on the footer (because I
want the image to be on a separate page) so, when there is no image,
and the footer is shown in error, there is an extra, blank page on the
report.
Again, I have verified that the field in question has a NULL value in
the errant examples. Some records with NULL values in the field work
correctly, and the extra page does not appear.
Can anyone advise me on how to debug this? How can I determine why the
Footer's format event (and print event) is being fired when it
shouldn't be?

Thanks in advance for any help you can provide.
 
R

rknowles

Thank you for your reply.

I have a text box placed in the report's Detail section with it's
control source set to FlowChartPg1 which is the Field in the table that
contains the image path. The text box is set to Visible = False. I have
created a grouping on that text box and set Group Footer = "Yes". In
the footer's properties, I have set Force New Page = "Before Section".
The only control in the footer is the Image control to display the flow
chart.

The first few records of my report have null values in the FlowChartPg1
field, and the report behaves as I hoped. No page is added. No image is
displayed. The format (or print) event is not fired for the footer.
Then I come upon a record that also has a null value in the
FlowChartPg1 field but, for some reason, a new page is added, and the
format event is fired for the footer. I can put code in the footer's
Format, or print event that sets the image's visible property to
"False" but, I still get the additional, blank page.

So I guess my issues are these:
1) I wish I could figure out why this happens for some records that
have null values in the FlowChartPg1 field, and not others (aren't the
footer's actions dependent on values being in the FlowChartPg1 field,
or is there some other causing factor?)
2) If I can't figure out what is causing the Format or Print event to
fire, then use VBA code to set the footer and image control's visible
properties to FALSE (I can do this already) and get rid of the extra
page that has been added (I don't know how to do this). I am already
using VBA to load the image file, and that works just fine.

Thank you again for your response. Any help you can give will be
appreciated.
Roger
 
R

rknowles

Thank you again for your response.

I have done that, it prevents the image control on the footer from
being shown, but I still get the blank page.
I did this in the FlowChartPg1Footer_Format event and got some good
results:
If IsNull(FlowChartPg1) Then
FlowChartPg1Footer.Visible = False
Cancel = True
End If

Except that now, the next page of the report, representing a new
record, has the previous record's header (UGH!).
Example:
record 3005, which has no image, appears on one page, as it should,
with no extra page added, etc., etc.
record 3006 has all the correct information for 3006, except its
header reads "3005".

Everything else works great. The image appears on a separate page when
it is supposed to, and doesn't appear (and no separate page is added)
when there is no image...
Now if I can just figure out the header thing.....

Duane said:
I would add code to the on format event of the section like:
Cancel = IsNull(Me.[SomeBoundControl])

--
Duane Hookom
Microsoft Access MVP


rknowles said:
Thank you for your reply.

I have a text box placed in the report's Detail section with it's
control source set to FlowChartPg1 which is the Field in the table that
contains the image path. The text box is set to Visible = False. I have
created a grouping on that text box and set Group Footer = "Yes". In
the footer's properties, I have set Force New Page = "Before Section".
The only control in the footer is the Image control to display the flow
chart.

The first few records of my report have null values in the FlowChartPg1
field, and the report behaves as I hoped. No page is added. No image is
displayed. The format (or print) event is not fired for the footer.
Then I come upon a record that also has a null value in the
FlowChartPg1 field but, for some reason, a new page is added, and the
format event is fired for the footer. I can put code in the footer's
Format, or print event that sets the image's visible property to
"False" but, I still get the additional, blank page.

So I guess my issues are these:
1) I wish I could figure out why this happens for some records that
have null values in the FlowChartPg1 field, and not others (aren't the
footer's actions dependent on values being in the FlowChartPg1 field,
or is there some other causing factor?)
2) If I can't figure out what is causing the Format or Print event to
fire, then use VBA code to set the footer and image control's visible
properties to FALSE (I can do this already) and get rid of the extra
page that has been added (I don't know how to do this). I am already
using VBA to load the image file, and that works just fine.

Thank you again for your response. Any help you can give will be
appreciated.
Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top