VBA used in Reports

T

txlandman

I have a report that when the OnOpen event is fired, I populate the unbound
controls with data via VBA. Most of my reports are 1 page and perform just
as they should. Page 1 is located in the Report header section. Page 2 and
beyond are located in the detail section. Here is the issue, when more than
2 pages are needed only 2 pages are printed and the data on page 2 is the
data from the last record picked up from my VBA code. I guess I need to
force some event to fire in order to "Print" a page once the unbound controls
are populated. Any help or guidance will be greatly appreciated.

Thanks
David
 
T

txlandman via AccessMonster.com

If I take this approach, should I change the event that calculates and
populates the unbound controls on the report. Also will this cause the
Report Header to print again? Thinking out loud....I can keep the populating
of the report header in the OnOpen event.....but where should I put the code
to populate page 2 thru ???......Can I build the query in the OnOpen event or
does the query need to be established prior to opening the report. Thanks
Alex for the input. The thought process is alive again.

Alex said:
Hi,
you can create a query with number of records=number of required pages2 and
bind your report to that query. then you will get required number of pages2
I have a report that when the OnOpen event is fired, I populate the
unbound
[quoted text clipped - 12 lines]
Thanks
David
 
A

Alex Dybenko

Hi,
I understand - you have a report with has 1 to x number of detail pages, so
this query just cause report to generate this number of detail records or
pages in your case. no need to change code in report header or detail
section. You can populate this query in open event.

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com


txlandman via AccessMonster.com said:
If I take this approach, should I change the event that calculates and
populates the unbound controls on the report. Also will this cause the
Report Header to print again? Thinking out loud....I can keep the
populating
of the report header in the OnOpen event.....but where should I put the
code
to populate page 2 thru ???......Can I build the query in the OnOpen event
or
does the query need to be established prior to opening the report.
Thanks
Alex for the input. The thought process is alive again.

Alex said:
Hi,
you can create a query with number of records=number of required pages2
and
bind your report to that query. then you will get required number of
pages2
I have a report that when the OnOpen event is fired, I populate the
unbound
[quoted text clipped - 12 lines]
Thanks
David
 
T

txlandman via AccessMonster.com

Thanks I will give this a try.

Alex said:
Hi,
I understand - you have a report with has 1 to x number of detail pages, so
this query just cause report to generate this number of detail records or
pages in your case. no need to change code in report header or detail
section. You can populate this query in open event.
If I take this approach, should I change the event that calculates and
populates the unbound controls on the report. Also will this cause the
[quoted text clipped - 19 lines]
 

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