How create report controls at runtime (VBA)

  • Thread starter Roberto Carabajal
  • 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
 
A

Allen Browne

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]...
 
M

Marshall Barton

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.
 

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

Top