Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    513

    control limit per form


    i am told that over the lifetime of a form there is a limit of 754 controls, and that this includes currently active controls, as well as those that had at one time been added, but had consequently been deleted, and no longer exist (?)

    is this correct, and if so, is there a way to tell where I'm at in the count (I have a hunch I'm getting into that zone-ish ...maybe)

    mark

  2. #2
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207
    The first thing that comes to mind is what scenario requires that you need that many controls on a single form? This would be unusual. Not saying that it would absolutely be wrong, maybe you have a lot of unbound controls with scientific calculations, I don't know, but it is definitely unusual. Having said that, you can recover the deleted controls by doing a Compact & Repair. Alternatively, you could create another empty db, import your form there, delete the form from the real db, then import it back in. As far as determining the number of controls currently on your form, there is no built in way that I am aware of, but you could do it with some VBA (example air code);

    Code:
    Dim ctl As Control
    Dim lngCount As Long
    
    For each ctl in Me.Controls
        lngCount = lngCount + 1
    Next ctl
    
    Msgbox lngCount

  3. #3
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    513
    perfect big thanks

    I'm attaching a few screen shots of the form with different tabs exposed, in case it spurs any other suggestions

    I suspect that going forward (this is an ongoing continual evolution of a form...), as the opportunity presents, I'll start using more pop-up forms (fired from events on this one), rather than piling still more controls onto the already 436 controls on this main form...

    again, thanks
    Attached Thumbnails Attached Thumbnails 2018-05-14_21-15-46.jpg   2018-05-14_21-16-30.jpg  

  4. #4
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207
    You could also use sub forms to help manage the number of controls. You could move some of these to another form, then place that as a sub form on one or more of the tabs on your tab control. If hide the borders of the sub form control you could make it look essentially the same as it does now. The only potentially difficult part might be if you have a lot of references to your form controls, either in code or in queries, you would need to modify the references for any controls that you move to a sub form.

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Hi Mark,
    I have definitely hit that limit in the past in a multi-tabbed form used as a "template" for new clients; we would customize it by deleting some unused and/or hidden controls and adding new ones to match the new business requirements. When you hit the limit you'll know as you will encounter form corruption and the form will refuse to be "saved" . The way I sued to deal with this was to start with a new form in design view, the old form in design view and copy and paste all the controls by section (first the header, then the detail and lastly the footer) from the old to the new, set the new form and section properties (caption, navigation, back color, etc.) to match the old one, copy and paste the entire VBA form module, save the new form with a different name, delete the old form, compact and repair and finally rename the form with the old name (maybe one more compact and repair after this). I found that this approach always reset the available controls and I was able to save the form.

    Cheers,
    Vlad

  6. #6
    Join Date
    Apr 2017
    Posts
    1,792
    You can write an UDF, which counts the number of controls in some active form (on fly: the function gets form as parameter, defines Control's object for this form, and counts controls in this object).

    Or you open the form in Design mode, activate it, and select Tab Order from menu. In opening popup window you can manually count all controls in form Header, Detail and Footer respectively. NB! Labels, Tab Control Pages etc. are left out!

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    But that does not give you the cumulative number of controls that were on the form over its lifetime (https://social.msdn.microsoft.com/Fo...orum=accessdev).

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 12-06-2011, 05:53 AM
  2. Replies: 5
    Last Post: 05-18-2011, 11:02 AM
  3. Replies: 6
    Last Post: 05-05-2011, 12:40 PM
  4. Text Box control and character limit?
    By Bigdoggit in forum Forms
    Replies: 2
    Last Post: 03-29-2011, 10:05 AM
  5. Replies: 4
    Last Post: 10-07-2010, 09:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums