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

SizeToFit Method

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
I am having trouble with the SizeToFit method. I have a report with two subreports in it. In the Report_Open section of my main report, I have a text box and the two subreports that are set to SizeToFit:

Private Sub REport_Open(Cancel As Integer)
txtJobDesc.SizeToFit
SubReport1.SizeToFit
SubReport2.SizeToFit
End Sub

I have text boxes on each sub-report that I want to size to fit. If I place the code in the Report_Open section of the sub report, it says I can only use this command in design view. I am trying to put the code in my main report, but I can't find any code that will work right. Any ideas? Thanks!
 
Like the code error says, you have to set the proper width in design time. Make sure you're text boxes and or sub reports are set to an appropriate width. Then set the controls 'Can Grow' property to true. This should allow the control to grow in height if need be at run time. To make the control wider through code you'll have to play around with it's width property but if you design it properly in design mode then this shouldn't be necessary.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top