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

Dynamically adjust location of controls

Status
Not open for further replies.

megmoo75

Programmer
Jun 14, 2003
40
0
0
US
Hello -

I have a two-column report consisting of 11 different subreports. What I would like to do is dynamically adjust the start point for each subreport (the top value) such that an equal amount of whitespace is added between each subreport while keeping it on a single page. My subreports all have CanGrow = Yes because the contents can range from nothing to several lines.

I have calculated the that maximum top value (in twips) for the invisible control to stay on one page would be 28800 (because there are two columns and my margins are .5" - 14400 twips per column). Therefore, it seems that I could put an invisble control at the end of my last subreport, then get the location of that control (from On Print). Then I could take 28800 minus the invisible control location and divide that value by 11, then add that value to the current top value of each subreport to move them accordingly.

I'm not sure that this is the best way to do it, so I'm open to suggestions on other ways to make this happen.

The issue I'm having with the current approach is that the OnFormat event, where I need to adjust the top value of my controls, happens before the OnPrint event. Therefore, I cannot get the value of the invisible control until after my report has been formatted.

Does anyone know how I can get the top value for my invisible control and then use that to move the other controls on the report around?

Thanks in advance!
 
If you are attempting to set format properties of controls such as the top or left property in the On Print event, don't waste your time. Once the Print event has begun, I don't think you can move anything. You can use the Line and Print methods in the On Print event.

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]
 
No, I'm attempting to move them in the OnFormat event, but I need to know how much to move each item and that depends on information I need from the OnPrint event.
 
The values from the On Print are not available in the On Format since the On Format occurs prior to the On Print.

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]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top