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

Calculation in Report requires two formatting passes to be correct

Status
Not open for further replies.

CautionMP

Programmer
Dec 11, 2001
1,516
US
I have a report that calculates a ranking by performing a Shell sort on a data array that is populated when the report opens. Because of this the report has to be generated twice before the resulting calculation is correct, i.e. if the report is opened to the screen (preview) or printed directly the ranking is listed 1, 2, 3 ... regardless of the data, if the previewed report is then printed the ranking is then correctly applied based on the underlying data.

Moral of the story I need to cause the entire report to run twice to get the calculation to show correctly.

Does anyone know a good way to force the report to generate twice (behind the scenes)? This way the report would be correct when it is previewed or printed without the added step of having the user preview the report (with the disclaimer that the calculation will be incorrect) then print the report to view the final (correct) calculation?

Thanks in advance for any input you can provide.
 
I would use temporary tables to contain values/records for your report. Since you haven't provided any details on why you need to shell sort then I can't provide better alternatives.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top