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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to advance to next record in report by code?

Status
Not open for further replies.

TimSzrejter

Programmer
Feb 13, 2001
18
US
I have written some code to create a table of contents for a report I have created. I have code in the Detail_Print event so that as you move from the first record to the last record in the report it writes the page number and description to a table. Then I can use this table to show a report on the table of contents.

My problem is the only way I know how to populate the table of contents is to click through each record. How can I accomplish this through code? I want it to go through each record when the report is opened so that the table of contents will be fully populated.

Thanks for any help!
Timothy Szrejter
 
Do a little reading in the help section on recordsets. They may be what you are looking for.
Mike Rohde
rohdem@marshallengines.com
 
I checked on recordsets. I do not see how that will help though. A report's recordsource must be a table, query, or SQL statement. Still, the only way I have found so far to advance the report to the next record is to physically click on the arrow button at the bottom of the report to move to next or last record.

Thanks,

Tim Szrejter
 
I suggest that you put the populating-table sub into the PageFooterSection_format event procedure. Therefore, you know what content is in each page. Then you create another report just for the "Content of the report."

Seaport
 
Tim,

I know this is an old question but I was wondering if you ever came across a fix for this as I have exactly the same issue.

Thanks
VB4ME
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top