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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control Limit Reached

Status
Not open for further replies.

theConjurian

IS-IT--Management
May 4, 2002
35
CA
As part of my application I have a form with a tab control (2 pages) and a subform (continuous form). I have reached the VB limit of 255 controls.

The error message suggests, "If you have deleted controls from this form or report in the past you may be able to rename the form and add more controls to it."

I have tried this in the literal sense, and have not found any way to work through this.

Even if I delete a control I cannot add any more. Is there no way of "resetting" the contol count so that it reflects the true number of objects in play?

Any suggestions are invited ...
 
Have you really got 255 unique control?
The limit on control array indexes is 32,767 , so use Control Arrays instead.
 
Do I have 255 controls? I did a quick count and figure I am at about 200, assuming you count labels separately from the control objects themselves. The form in question has a tab control and 2 pages with one continuous subform.

And if the TRUE limit is 32,767 then what is Access REALLY trying to tell me. I still can't add any more controls.

Also, I thought that control arrays referred to like-named and like-typed objects.
 
Is this an Access form? I was quoting from the VB documentation. However, there is no reason not to make all the labels (if they are static) one array. Likewise text boxes and any similar controls that have no code behind them.
It is only when you want to use the events that you have to have different names - even this could be worked around by Select Case Index where index is the control number.
Often in fact is is more useful to have control arrays, since you can then use their index.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top