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!

Set Sub Report Height 1

Status
Not open for further replies.

TimTDP

Technical User
Feb 15, 2004
373
ZA
In Access 2000, I have a report with a subreport.
The SourceObject of the sub report changes, depending on the main report. This I have working nicely, thanks to Roy Vidar.

How do I change the height of the subreport at run time?
 
As in other than Can Shrink / Can Grow?
This snippet in the On Open event sets the height in twips:[tt]'1440 twips = 1 inch
Me.Controls("SubreportControlName").Height = 500[/tt]
 
I have tried this and it has no effect!
 
Is Can Shrink or Can Grow set to Yes? If so, it may mask the changes to the height of the control. I tested this with Access 2000, using what I guess to be your set up, that is a sub report in the report header which changes its Source Object.

Code:
Private Sub Report_Open(Cancel As Integer)
If <Condition> Then
    Me.Controls("rptReport Subreport").SourceObject = "Report.rptReport Subreport"
  '1440 twips = 1 inch
    Me.Controls("rptReport Subreport").Height = 500 'twips
Else
    Me.Controls("rptReport Subreport").SourceObject = "Table.tblTable"
    Me.rptReport Subreport.Height = 6000 'twips
End If
End Sub
[Ponder]
 
Can you e-mail me your test database?
 
fredthomas98765@yahoo.com

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top