[AccessD] Questions about the Maximum Number of Controls Added Over the Lifetime to a Form (Access 2007)

Stuart McLachlan stuart at lexacorp.com.pg
Mon Jan 23 17:15:37 CST 2012


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.

Function ControlCount(FormName As String) As Long
Dim strTemp As String
Dim lngCount As Long
SaveAsText acForm, FormName, CurrentProject.Path & FormName & ".txt"
Open CurrentProject.Path & FormName & ".txt" For Input As #1
While Not EOF(1) And lngCount = 0
Line Input #1, strTemp
strTemp = Trim$(strTemp)
If Left$(strTemp, 12) = "ItemSuffix =" Then
    lngCount = Val(Mid$(strTemp, 13))
End If
Wend
Close #1
Kill CurrentProject.Path & FormName & ".txt"
ControlCount = lngCOunt
End Function





On 23 Jan 2012 at 16:50, Brad Marks wrote:

> Charlotte,
> 
> Yes, that helps a lot.
> 
> Being a curious type of person, I would think that there would be some
> way to see the "Lifetime" count in Access.  I don't know if my form in
> question is in the 200 range, 300 range, or dangerously close to the
> max.
> 
> I plan to experiment with Sub-Forms, but I would rather not incur
> changes if I knew that I was a long ways from the Max.
> 
> Thanks again,
> Brad
> 
>  
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte
> Foust
> Sent: Monday, January 23, 2012 4:45 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Questions about the Maximum Number of Controls
> Added Over the Lifetime to a Form (Access 2007)
> 
> OK, tab controls are kind of odd containers, much like option groups.
> The
> controls they contain are part of the count for a form, not just the tab
> control itself.  The easiest way to avoid problems is to use subforms on
> the tab pages, since each subform is a single control but it can also
> contain up to the lifetime maximum controls, which only count on the
> subform and not on the parent form.  That's how you get around the
> limits,
> by using subforms wherever practical.  The subforms don't have to show
> data, they can contain nothing but buttons, if you wish.  You can use an
> unbound subform to call global routines and merely reference the parent
> form's information to pass the required values to the call.  Does that
> help?
> 
> Charlotte Foust
> 
> On Mon, Jan 23, 2012 at 2:35 PM, Brad Marks
> <BradM at blackforestltd.com>wrote:
> 
> > Charlotte,
> >
> > Thanks for the info.
> >
> > I sort of remember this discussion from a few weeks ago, but I wasn't
> > fully paying attention at the time.
> > Today, I started to think about this some more and decided to do some
> > experimenting.  I also tried to find the earlier discussion in the
> > AccessD Archives but hit a snag.
> >
> > I have a form with about 10 tabs.  Each tab has a number of buttons,
> > etc.  I have not been careful with adding and deleting buttons, so I
> > would like to be able to see what the "Lifetime" number is for this
> > form.
> >
> > I appreciate your advice on how to deal with the problem if the limit
> is
> > reached.
> >
> > Thanks again,
> > Brad
> >
> >
> >
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte
> > Foust
> > Sent: Monday, January 23, 2012 4:21 PM
> > To: Access Developers discussion and problem solving
> > Subject: Re: [AccessD] Questions about the Maximum Number of Controls
> > Added Over the Lifetime to a Form (Access 2007)
> >
> > Didn't we just have this discussion a few weeks ago?  As far as I
> know,
> > you
> > can't determine how many have been added.  The number is stored
> > internally
> > is some arcane form that on Access sees.  Ordinarily, well designed
> > forms
> > (which means you don't put everything on a single form) don't hit the
> > limit
> > ever.  If you do hit the limit, one cure is to create a new form and
> > copy
> > and paste the controls and code from the old form, then renaming the
> old
> > and new forms as needed.  One suggestion made in our last discussion
> of
> > this was to save the maxed out form to a text file and then import it
> > into
> > a new form in Access.  That will certainly work with the code, but
> I've
> > never tried more than that.
> >
> > Charlotte Foust
> >
> > On Mon, Jan 23, 2012 at 1:32 PM, Brad Marks
> > <BradM at blackforestltd.com>wrote:
> >
> > > All,
> > >
> > > I noticed that there is a maximum of 754 controls that can be added
> > over
> > > the lifetime to a form.
> > >
> > > I understand how to determine how many controls are currently on a
> > form,
> > > but I don't understand how a person can discern how many have been
> > added
> > > "over the lifetime" of the form.
> > >
> > > Also, if a Form hits this limit, is there an easy way to deal with
> > this
> > > issue?
> > >
> > > Thanks,
> > >
> > > Brad
> > >
> > > PS. I tried a search on the AccessD archives but hit a snag.
> > >
> > > --
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > http://databaseadvisors.com/mailman/listinfo/accessd
> >
> >
> > >
> > >
> > > Website: http://www.databaseadvisors.com
> >
> >
> > >
> > >
> > >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> >
> >
> > Website: http://www.databaseadvisors.com
> >
> >
> >
> > --
> > This message has been scanned for viruses and
> > dangerous content by MailScanner, and is
> > believed to be clean.
> >
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> >
> >
> > Website: http://www.databaseadvisors.com
> >
> >
> >
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 

--
Stuart McLachlan

Ph:    +675 340 4392 
Mob: +675 7100 2028
Web: http://www.lexacorp.com.pg



More information about the AccessD mailing list