Acc2002 CanGrow

  • Thread starter Thread starter katz
  • Start date Start date
K

katz

Hello!
I have an interesting problem. I have a Unbound control on a report and the
control doesn't grow if the data is more then the box could fit. But when I
go to design view and preview again then it works. Is there anything I can
Do?

Thanks in advance
 
How do you populate the Unbound Control on the Report? Which Event do you
use to run the code to populate the Unbound Control?

I think in the Report processing, Access will adjust the size the the
TextBox just before the Format Event of the Section, IIRC.
 
"Van T. Dinh" wrote
How do you populate the Unbound Control
on the Report? Which Event do you use
to run the code to populate the Unbound
Control?

I think in the Report processing, Access will
adjust the size the the TextBox just before
the Format Event of the Section, IIRC.

It's kind of difficult to execute code to populate the unbound Control
_before_ the Format event of a Report Section, isn't it? There are only
Format and Print events, and Print runs after the Format.

I think the definitive answer is "Don't count on CanGrow / CanShrink with
unbound Controls."

Larry Linson
Microsoft Access MVP
 
Hi Larry

I think it is possible, e.g. Report_Open Event ...

I can't find any code setting TextBox value at present but I actually
changed the Cation on generic Labels in the Detail Section using the
Report_Open Event. Here a tidbit of code in the Open_Event of one of my
Reports:

********
...
If lngRecordCount > 0 Then
intSRptIndex = intSRptIndex + 1
strSRptIndex = Format$(intSRptIndex, "00")
Select Case bytMachPosID
Case fnMachPosID("EXT_C")
.Controls("lblMach" & strSRptIndex).Caption = " Core
Extruder" & _
(" (" + rsBRMachine.Fields("MachModelName").Value + ")")
& " General Settings"
.Controls("srptMach" & strSRptIndex).SourceObject = _
"Report.rsrBestRun_MachineParam_ExtruderCore"

Case fnMachPosID("EXT_S")
.Controls("lblMach" & strSRptIndex).Caption = " Skin
Extruder" & _
(" (" + rsBRMachine.Fields("MachModelName").Value + ")")
& " General Settings"
.Controls("srptMach" & strSRptIndex).SourceObject = _
"Report.rsrBestRun_MachineParam_ExtruderSkin"

Case fnMachPosID("EXT_ST")
.Controls("lblMach" & strSRptIndex).Caption = " Striping
Extruder" & _
(" (" + rsBRMachine.Fields("MachModelName").Value + ")")
& " General Settings"
.Controls("srptMach" & strSRptIndex).SourceObject = _
"Report.rsrBestRun_MachineParam_ExtruderStripe"

End Select
End If
DoEvents
....
********
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top