Reports.Item is invalid: you need a report name in there, like
Reports("NameOfReport").Item("subreport").windowheight
Note, too, that "subreport" needs to be the name of the subreport control on
the report. Depending on how you added the subreport, the name of the
subreport control can be different than the name of the report being used as
a subreport.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"DanWH" <(E-Mail Removed)> wrote in message
news:B76E1936-57DD-435F-835F-(E-Mail Removed)...
> I'm creating a report that is required to be in a specific format which
> has a
> text box in the detail followed by a subreport directly to the right of
> the
> text box. The subreport will grow depending on the amount of data. What
> I
> want is the text box adjacent to it to be sized on the report equal to the
> subreport.
>
> What I've tried writing is:
>
> Dim height as interger
> height = reports.item("subreport").windowheight
> me.textbox.height = height
>
> but I get the error stating that subreport cannot be found. Is this the
> right code or what am I doing wrong.
>
> Thanks
> Dan