Which subreport Event to use

  • Thread starter Thread starter Sam Davis
  • Start date Start date
S

Sam Davis

Hi all,

I have a subReport where I wish to alter the location and size of controls
within a section (GroupHeader) based on the after CanGrow height of this
section.

I'm in a catch 22 situation - OnFormat occurs before the section has grown
and OnPrint is too late to change the location and size of controls.

One path I've been pursuing (without sucess)....
In this case the required control location/size changes will apply to all
records of the subreport each time it is called from the main report. In
addition I can accurately calculate the required after CanGrow value via
dlookups and such (a lucky consequence of a work around for the vertical
text error) if I can determine one field value in the subReport data. So I
thought I'd use OnOpen (which fires for subReports) but the subReport data
isn't avaialable. OnLoad is no good as it doesn't fire for subReports
(although works great if the subReport is opened directly).

Hope this all makes sense - any ideas to try would be greatly appreciated.

Thanks

Sam
 
Most of the text box and label controls you can display in your report can be
created in code in the On Print event using Me.Line or Me.Print. You can
control size, font, location, and much more.
 
Thanks Duane,

I use Me.Line all the time for borders, but haven't used Me.Print before.
I'll do some research and give it a go - and then let you know how I go...

Sam
 
You set the coordinates of the Me.Print with
Me.CurrentX = ...
Me.CurretnY = ...
Me.Print "Text To Print: " & Me.TxtBoundControl.Value
 
Too easy... works great....

I've also set all the font properties to those of the hidden textbox.

I'll be using this to display mixed font/bold/italic/etc. in a single
(simulated) textbox.
I'm wondering, is there a way to Me.print text vertically?

Thanks muchly,

Sam
 
Back
Top