[AccessD] Form Lifetime Control Limit (Was: Advice on A2010....)

William Benson (VBACreations.Com) vbacreations at gmail.com
Wed Dec 14 20:12:16 CST 2011


And how do you recommend deleting *precisely* the first 400 controls?;-)

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert
Sent: Wednesday, December 14, 2011 6:11 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Form Lifetime Control Limit (Was: Advice on
A2010....)

Try this:

1. Use TestControlLifetimeLimit() to fully populate a form.

2. Save as "Form1"

3. Delete the FIRST 400 controls.

4. Run TestControlLifetimeLimit(Forms(0)). Note that it can't add any more
controls.

5. Close the form. Run these commands:
     application.saveastext acForm, "Form1", currentproject.Path & "\" &
"Form_Form1"
     application.loadfromtext acForm, "Form1", currentproject.Path & "\" &
"Form_Form1"

6. Design the form. Run TestControlLifetimeLimit(Forms(0)).

Here I predict two things:
A. This will fail for Access 97 forms, even those imported into a later
version of Access. This is the classical 'lifetime limit' error.
B. This will succeed for forms created in A2K or later.

So, for the authors of EatBloat, I would modify their documentation to say:

For Forms & Reports created in Access 2000 or later:
> SaveAsText/LoadFromText will reset the control count, allowing you to add
> more controls up to the version control limit.
> For Forms & Reports created in Access 97 or earlier:
> SaveAsText/LoadFromText will NOT reset the control count. You must edit
the
> ItemSuffix attribute in the text file (and possibly rename controls) to
> reset the control count. This behavior will persist, even if the form is
> imported into a later version of Access.
>

-Ken
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list