CreateControl function query (VBA)

Copper Contributor

Hi

 

Regarding this function, I've been able to identify from an online search that this function is limited to 754 controls over the lifetime of a form. Is this limit still the case in the latest version of Access or has it been removed since?

3 Replies
There is still a limit though it is higher than the figure still quoted. The last time I tested, the limit was around 1000 controls over the lifetime of a form. I'll try to find a link to the thread where the limit was investigated a couple of years ago.

However, in my opinion, if your forms have anything like this number of objects in practice then the design is far too complex and should be modified to simplify its structure.

@isladogs I wasn't aware the limit had been increased, but either way, it's substantially more than would ever be required in a practical sense.

 

One of the reasons I've seen for inquiring about the limit is in anticipation of creating a "dynamic form" in which controls are added and deleted from the form as part of a regular process. I even wrote an article on doing that a couple of decades ago, before I learned of this problem. I was creating command buttons on a menu form as part of a dynamically recreated form. I came to understand the totally impractical nature of that approach, though, quite quickly when the then-limit of 754 was reached.

@George Hepworth 

Just found the link I was referring to:

Exceeding Limits via Code? | Access World Forums (access-programmers.co.uk)

 

The form control limit seems to be 1038 in the latest versions of Access