Dynamically inserting textboxes.

M

Mr.Smith

Can I do this?

I am wanting to add textboxes and lines to a form, set their dimensions and
position and name them using VBA code. What I want to happen is for Access
to add these controls using VBA dependant on the number of records in a
dataset during Form_Load.

Can it be done and if so how?

Regs,
Mr. Smith
 
M

Mr.Smith

Mr.Smith said:
Can I do this?

I am wanting to add textboxes and lines to a form, set their dimensions and
position and name them using VBA code. What I want to happen is for Access
to add these controls using VBA dependant on the number of records in a
dataset during Form_Load.

Can it be done and if so how?

Regs,
Mr. Smith


PS: This development is an Access 2000 adp project.
 
H

Hugh O'Neill

Mr.Smith said:
PS: This development is an Access 2000 adp project.


I don't know if the same limitation applies to an adp as it does to an
mdb but there is a limit of 754 (don't ask!) controls of any kind
created during the lifetime of a Form. Even a line is a control.

The usual way around this is to create as many of the different
controls as you are likely to need and then to turn their visibility on
and off and/or move them around as required.

hth

Hugh
 
R

Ron Weiner

Hugh

I was unaware of the 754 Lifetime limit. Does this mean that if I create
one new control on a form each time I open the form (Even though I do NOT
save the form with the new control), that on the 755th time I open the form
I will get an Error?

I have found KB 208192 ACC2000: Errors Converting or Importing with 754 or
More Controls, but this alludes to actually having that much stuff on the
form when it is opened. Based on what I read here if I had a form with 753
controls and deleted one, and added another (still had 753) I'd be OK even
if I did this 10 times.

I have just developed an App that opens a "template" form in Design mode
that has a few controls on it and adds additional controls as needed, then
opens the form in Normal mode for interaction with the user. When the form
is closed it is closed without saving. Am I heading for a problem?

Ron W
 
H

Hugh O'Neill

Ron said:
Hugh

I was unaware of the 754 Lifetime limit. Does this mean that if I
create one new control on a form each time I open the form (Even
though I do NOT save the form with the new control), that on the
755th time I open the form I will get an Error?

I have found KB 208192 ACC2000: Errors Converting or Importing with
754 or More Controls, but this alludes to actually having that much
stuff on the form when it is opened. Based on what I read here if I
had a form with 753 controls and deleted one, and added another
(still had 753) I'd be OK even if I did this 10 times.

I have just developed an App that opens a "template" form in Design
mode that has a few controls on it and adds additional controls as
needed, then opens the form in Normal mode for interaction with the
user. When the form is closed it is closed without saving. Am I
heading for a problem?

Ron W


No, deleting a control still leaves a used slot. I don't know if the
available slots are used up if you don't save the form because I've
never tried that.

Hugh
 

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