How create report controls at runtime (VBA)

  • Thread starter Thread starter Roberto Carabajal
  • Start date Start date
R

Roberto Carabajal

Hello:
I would appreciate that somebody shows how to create textboxs or labels in a
report from VBA code, I tried sintaxis like used in VB6 but didn´t work. I
need to create an object within the Report_Page() event.
Thanks in advance.
Roberto
 
You cannot do that.

You can create controls in report design view only, not while any of its
events are running.

In general, you don't want to use design view as it will prevent you
releasing an MDE later. CreateControl is useful only for things like
wizards.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
Roberto said:
I would appreciate that somebody shows how to create textboxs or labels in a
report from VBA code, I tried sintaxis like used in VB6 but didn´t work. I
need to create an object within the Report_Page() event.


Even if you could find a way to do that, it would be a
really bad idea. Instead, precreate a sufficient number of
invisible text boxes and make them visible as needed.
 
Back
Top