How to create a custom control in runtime in msaccess?

S

Surendra

Hi,
my doubt is how to create a custom control say richtextboxor some other
control using method CreateReportControl or some other available
method.Thanks in advance , if you come to know please explain.
 
J

John Spencer

If you mean you are using Access Runtime, then I believe it is not possible
to create a control on a report. If you mean you want to add a control to a
report at time of execution, that can be done - but only in design mode.

The best way to handle either situation is to add the control in design
mode. Then use code to set its visible property to true or false as you
need the control to be seen. You can also use code to move the control (and
other controls) and to change the controls source, etc.
 
R

Rick Brandt

Surendra said:
Hi,
my doubt is how to create a custom control say richtextboxor some
other control using method CreateReportControl or some other available
method.Thanks in advance , if you come to know please explain.

While common in other environments, any attempt to create controls during
runtime in Access are doomed to failure. You have to have the container object
(form/report) open in design view to create controls and there is a lifetime
limit on how many controls can be created on any one from or report that you
will eventually hit.

The usual advice is to create whatever controls you might need during design
time and make them hidden. Then it is fairly easy to make those controls
visible and change their properties in runtime.
 

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