[AccessD] AccessD Digest, Vol 107, Issue 18

Kenneth Ismert kismert at gmail.com
Mon Jan 23 18:20:25 CST 2012


Recaping the group's earlier thread:


> Brad Marks:
>
> I noticed that there is a maximum of 754 controls that can be added
> over the lifetime to a form.
>

Control Counts by Version (per Jim Dettman):
A97 - 753
A2000 - 800
A2002 - 894
A2007 - 1040
A2010 - 1040

... I don't understand how a person can discern how many have been
> added  "over the lifetime" of the form.
>

Simple: just add a new control to the form. The numeric suffix shows your
current lifetime count.


> Also, if a Form hits this limit, is there an easy way to deal with this
> issue?
>

if you created the form in Access 2000 or later, just use these two lines
of code:

    Application.SaveAsText acForm, "Form1", CurrentProject.Path &
"\Form_Form1"
    Application.LoadFromText acForm, "Form1", CurrentProject.Path &
"\Form_Form1"

Lots simpler and more accurate than creating a new form and copying all
controls and properties over.

Caveat: if your form was created in A97, properly fixing the problem is
much harder.

And, responses to other posts:

Gary Kjos:
>    For Each ctl In Me
>        lngCount = lngCount + 1
>    Next ctl
>

Otherwise known as Me.Controls.Count

Stuart McLachlan:
> You can see the Lifetime count if you save the form as text and look for
> ItemSuffix in the
> resulting file.
>
> Here's a quick and dirty function I've just knocked up to do it....
>

This code works, and the results are identical to the 'add a new control
and look at the numeric suffix' method, above.

-Ken


More information about the AccessD mailing list