Reports and Events

  • Thread starter txlandman via AccessMonster.com
  • Start date
T

txlandman via AccessMonster.com

I am writing a report that derives all of its data from VBA code written in
the OnOpen event of the report. The report is usually 1 page in length so the
data is populated in the Report Header Section with the detail visible
property set to false. However if I have data that overruns to multiple pages
then I set the visible property of the detail section to True. The problem is
that when there is data to multiple pages I only get the last page of data.
Again all data is populated in the OnOpen event of the report. Should I
populate the detail section in a different event?

Thanks
David
 
M

Marshall Barton

txlandman said:
I am writing a report that derives all of its data from VBA code written in
the OnOpen event of the report. The report is usually 1 page in length so the
data is populated in the Report Header Section with the detail visible
property set to false. However if I have data that overruns to multiple pages
then I set the visible property of the detail section to True. The problem is
that when there is data to multiple pages I only get the last page of data.
Again all data is populated in the OnOpen event of the report. Should I
populate the detail section in a different event?


Report values should be populated in the section with the
controls you are setting.

Unbound report's can be tricky so you should provide more
details about where/how you are deriving the data,
especially anything that is displayed in the detail section.
 
T

txlandman via AccessMonster.com

Marshall said:
I am writing a report that derives all of its data from VBA code written in
the OnOpen event of the report. The report is usually 1 page in length so the
[quoted text clipped - 4 lines]
Again all data is populated in the OnOpen event of the report. Should I
populate the detail section in a different event?

Report values should be populated in the section with the
controls you are setting.

Unbound report's can be tricky so you should provide more
details about where/how you are deriving the data,
especially anything that is displayed in the detail section.
In the OnOpen event of the report I build several recordsets from the backend
tables. From that data I populate the unbound objects on the 1st page(Report
Header Section), during this process I determine if one of the recordsets has
too many records to fit on page 1 if so I make the detail section visible
then I populate the data on page 2. I added page breaks then made them
visible to increment the page so I could populate page 3. However, this
technique did not work, and while I got a page 2, it contained page 5's data.
Hope this more detailed explanation helps.

Thanks
David
 
M

Marshall Barton

txlandman said:
Marshall said:
I am writing a report that derives all of its data from VBA code written in
the OnOpen event of the report. The report is usually 1 page in length so the
[quoted text clipped - 4 lines]
Again all data is populated in the OnOpen event of the report. Should I
populate the detail section in a different event?

Report values should be populated in the section with the
controls you are setting.

Unbound report's can be tricky so you should provide more
details about where/how you are deriving the data,
especially anything that is displayed in the detail section.
In the OnOpen event of the report I build several recordsets from the backend
tables. From that data I populate the unbound objects on the 1st page(Report
Header Section), during this process I determine if one of the recordsets has
too many records to fit on page 1 if so I make the detail section visible
then I populate the data on page 2. I added page breaks then made them
visible to increment the page so I could populate page 3. However, this
technique did not work, and while I got a page 2, it contained page 5's data.
Hope this more detailed explanation helps.


I understood the problem before. What I need is details
about the recordsets, the controls in the detail section,
and how the controls are related to the recordsets' data.

Each section of a report is limited to 22 inches in design
view so either you are doing something to get multiple
instances of the detail section or you are cramming an awful
lot of can grow controls into the detail section.

The latter is not a viable approach because forms and
reports are limited to 754 controls.

If you are using multiple instances of the detail section
(via Me.NextRecord = False), then it is critical that you
manage the recordsets' records carefully in the detail
section's Format event.
 

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