Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reached the control limit need to create an array of controls

Status
Not open for further replies.

rew2009

Technical User
Apr 21, 2009
114
US
I have reached the 255 controls limit on my form and I understand that the only way to get past it is to create an array of controls such as a text box array. How do you do that and where do you put the code?

Thanks
 
Is this an Access form or VB form? There are no control arrays in Access. Also the limit is 754 controls added (including deleted) over the life of a form

If you exceed this number you may first try to copy your controls, and past into a new form. I am not certain, but I think that may remove the deleted control count. So if you have 300 visible controls and 454 deleted controls it may set your count back to 300. I am not certain on that.

If for some reason I would ever need a form with that many controls (and I for sure can not think of any possible reason) I would build that form dynamically through code.

The simple is solution group the controls into subforms.
 
It is and access form. Thanks for the info, I will try that approach. Another solution could be more popup forms rather than tabbed pages. I have 16 tabbed pages in this form and I probably should have many of the pages as popup forms instead, however, I haven't quite figured out how to have the new popup form (bound to the same table) go to the same record that was current in the original form.

Your thoughts?

 
How are ya rew2009 . . .

You can add an extension table in a [blue]one to one relationship[/blue] and add your other controls. This type of relationship is rarely used but maybe what you need.

See setup for a [blue]one to one relationship[/blue] here: Fundamentals of Relational Database Design

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
I haven't quite figured out how to have the new popup form (bound to the same table) go to the same record that was current in the original form.

There are several ways to do this, and we can help if you decide to go that path. Going to the same record is very easy and actually if you use the wizard it will write the code for you.

The next question is why do you have over 200 controls from one table? When someone says they have over 30 fields in a table, nine times out of ten their data is not normalized. Can you explain why so many fields and controls? You likely have a bigger problem.


The limit for a table is 255 fields and you can do what AceMan said by breaking up the table into multiple tables and simply have a one to one relationship. I have written a lot of databases in my time and can only think of 2 cases that came close to that limit where the data was normalized. One captured sensor readings for a given period of time. Each record was a time and all of the 100+ sensor readings. The other was a computer simulation that recorded every characteristic for an entity at a given period of time.
 
I solved the problem by taking MajP advice. I copied the controls to a new form, pasted the code for the ones for the events that I was using and removed two of the tabbed pages that had many text boxes and xfered them to new popup forms and it is all working fine now. Thanks!

I have so many fields in one table because I began this database back in the 80's in dBase 2 and 3 in DOS and it was easier to put everything in one table. I could have broken the table up, but at that time tables got corrupted more easily than today and if one out of three connected tables corrupted then it seemed easier to have backup tables with all the data synchronized to a certain date. I had particular trouble with memo fields (“blob” fields) corrupting in dBase. Anyway, that is the history. Now things are much better and I haven’t had those problems since I switched over to Microsoft SQL server and use access. But it is a learning process implementing new programming procedures and time consuming making changes. Sometimes it is easier just staying with the base structure that I already have. However, I am starting to make several changes including now working with several connected tables that I am slowly xfering info over to. Anyway, I appreciate all the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top