Exceeding Limits via Code? (1 Viewer)

MajP

You've got your good things, and you've got mine.
Local time
Today, 01:11
Joined
May 21, 2018
Messages
8,525
In this thread
https://www.access-programmers.co.uk/forums/showthread.php?t=307626

The OP could not paste all the controls from the form into a report. There is a label and a textbox for every possible day of a month. ~ 40 * 12 * 2. Over 900 controls. I never thought about it, but I am guessing I coded the original form to avoid a lot of name changes. Supposedly 754 is the max. So my question is has the limit increased or can you add more controls via code. I have not seen it listed that you can create more controls via code, but I have not yet hit a limit.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 06:11
Joined
Jul 9, 2003
Messages
16,274
I realise this is not the answer you were angling for, and I'm pretty sure you know this, but I thought I would mention it for anyone else who is taking an interest in this thread.

To avoid the limit of the number of controls on a form which I understand me around about 740 (it's interesting that you have got to 900! Something well worth investigating)

My approach would be to make a single subform for a Month, a generic month, and it would be a long thin form spanning subform, the same as months you show on your form.

Then you repeat this subform down the page until the form had the 12-months of the year showing.

But here's the interesting bit, you've only got two forms, the main form the form holding the subforms, and the generic subform for a generic month. Now you program the month name the number of days and everything, and fill out each month row programmatically.

I did something similar a couple of years back for a car hire calendar to display when hire cars were out on hire.

I have a sample database I could send you somewhere it's not very slick, just a basic working example of the technique.

Sent from Newbury UK
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:11
Joined
Oct 29, 2018
Messages
21,455
I don't have a reference either, but I thought the limit was the limit. I had no idea you can get around it by using code. Interesting...
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:11
Joined
Oct 29, 2018
Messages
21,455
So, I just did a quick experiment adding controls to a form using code and it stopped and gave me an error after adding 1040 controls to an empty form. I guess there is a limit after all.
 

jdraw

Super Moderator
Staff member
Local time
Today, 01:11
Joined
Jan 23, 2006
Messages
15,379
Interesting - I understood max number of controls on form (over its lifetime) was 754???
I guess there have been some "unmarketed" changes along the way???

Update:
Just looked it up here M$oft says 754? Hmmm?

Number of controls and sections that you can add over the lifetime of the form or report 754
 

isladogs

MVP / VIP
Local time
Today, 06:11
Joined
Jan 14, 2017
Messages
18,209
See this related thread: https://access-programmers.co.uk/forums/showthread.php?t=211166

I've just tested cloning existing controls on my monthly date picker form to create duplicates. I added 12 lots of monthly controls and the totals was just under 700. I then copied 6 of those sets of monthly controls bringing the total to 1015.



Having exceeded the limit by that means, I was then unable to add or delete controls and the form became unresponsive when I tried to do so.
 

Attachments

  • LotsaControlsPNG.PNG
    LotsaControlsPNG.PNG
    76.7 KB · Views: 503

MajP

You've got your good things, and you've got mine.
Local time
Today, 01:11
Joined
May 21, 2018
Messages
8,525
So I am guessing the limit is around 1040 and MS has just not updated their websites. It was not a result of the code.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 15:11
Joined
Jan 20, 2009
Messages
12,851
I have sometimes wondered what the significance of 754 would be. It doesn't seem to have a power of 2 relationship.

I Googled and did find something coincidental but obviously irrelevant.

The standard for Binary Floating Point is IEEE 754 ;)

Anyone got any suggestions?

1040 is an unusual number too.
 

sonic8

AWF VIP
Local time
Today, 07:11
Joined
Oct 27, 2015
Messages
998
To avoid the limit of the number of controls on a form which I understand me around about 740 (it's interesting that you have got to 900! Something well worth investigating)
The limit was 754 with Access 97. It was slightly increased with each following version. IIRC it was around the 870 mark with Access 2002 when I last checked it. If that trend continued it would make sense for the limit to be now above 1K.
Microsoft never bothered to update that number in the specification page.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 00:11
Joined
Feb 28, 2001
Messages
27,148
While I have no direct knowledge of the internals, I would offer the idea that 754 as a limit might have originated with how many control structures one could fit in a particular chunk of memory that was governed by memory management limits. Earlier memory control registers were limited in how many bytes they could remap at once, and you have to just know that a lot of memory "diddling" occurs inside Access, particularly if you have multiple DB backends open.

Which is probably why when the rest of Office got some benefits from 64-bit versions, Access didn't. The code to go change all of the 32-bit memory relocation registers would have been so pervasive that they didn't want to screw with it for fear of breaking it badly. (Or worse, they DID try to screw with it and DID break it badly.) But of course that is conjecture.
 

isladogs

MVP / VIP
Local time
Today, 06:11
Joined
Jan 14, 2017
Messages
18,209
Just retested - the limit in A2010 32-bit created by cloning control is 1038.
Any logic in that particular value?
 

Attachments

  • Capture2.PNG
    Capture2.PNG
    83.5 KB · Views: 292

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 00:11
Joined
Feb 28, 2001
Messages
27,148
Again, not a matter of logic. Whenever I hear the limit is X and that number is neither an integer multiple of 100 nor a power of 2, I think of it as deriving from a capacity issue.

For instance, a form in Access cannot exceed 22.75 inches in width. Know why? Because the width is in twips, 1440 to the inch, and 22.75 x 1440 = 32760. By odd coincidence, that number is 7 less than the largest signed 16-bit integer 32767. So that is as big as you can go with a 16-bit width declaration. And a form/report section height is ALSO limited to 22.75 inches. Another 16-bit slot limited to 32760 twips. But oddly enough, 32760 is ALSO the limit on the size in bytes of an SQL .Recordsource or .Rowsource. Yet another 16-bit counter involved, probably.

There are other limits that tell you about sizing. For instance, the maximum size of a short text field is 255 characters. The maximum condition string for macros is 255 also. That number comes up now and then. Of course, 255 is the maximum count of an 8-bit unsigned integer, so that one is obvious. The number of printed pages in a report is 65,536 (max unsigned 16-bit integer +1) Again, obviously based on a power of 2.

I have NO clue as to why that particular number 1038, but whatever they are using to hold form and report controls, with a bizarre number like that, it is probably space-limited by whatever structure is holding the control and whatever size of memory is available as the workspace. It probably derives from the fact that you can access controls as an indexed collection, which implies an array.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 06:11
Joined
Jul 9, 2003
Messages
16,274
Did Douglas Adams work on the Microsoft Access Development Team?
 

isladogs

MVP / VIP
Local time
Today, 06:11
Joined
Jan 14, 2017
Messages
18,209
Has the limit changed to 42?


Sent from my iPhone using Tapatalk
 

missinglinq

AWF VIP
Local time
Today, 01:11
Joined
Jun 20, 2003
Messages
6,423
The difference between data entered thru the keyboard, and that entered thru code, is not in this instance, unique...for Memo Fields (Long Text, I believe, in later versions) can have up to 65,535 characters, or there about, when typed in...but when entered thru code is only limited by the size of the database. The only other caveat, I seem to remember, is that the data must only be aplha-numeric.

Actually, I think the Access Gnomes simply pull these numbers out of their hats...or perhaps out of some bodily orifices!:eek:

Linq ;0)>
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 06:11
Joined
Jul 9, 2003
Messages
16,274
Has the limit changed to 42?

Well it does appear to vary... But I was thinking more along the lines of:- You have the number 754 which could be modified thus... 7 - 5 = 2 therefore you can derive 42 from 752... A bit Countdownish
 

isladogs

MVP / VIP
Local time
Today, 06:11
Joined
Jan 14, 2017
Messages
18,209
Well it does appear to vary... But I was thinking more along the lines of:- You have the number 754 which could be modified thus... 7 - 5 = 2 therefore you can derive 42 from 752... A bit Countdownish

Umm. I think you may have missed my feeble attempt at humour there....:rolleyes:

42=the Answer to life, the universe and everything according to the Deep Thought computer in the Hitchhikers' Guide to the Universe
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 06:11
Joined
Jul 9, 2003
Messages
16,274
Umm. I think you may have missed my feeble attempt at humour there....:rolleyes:

42=the Answer to life, the universe and everything according to the Deep Thought computer in the Hitchhikers' Guide to the Universe

No, I didn't miss it at all, exactly what I meant - I was referring to the 42... as the answer to the ultimate question - and my second post was an attempt to carry it forward into something silly, and hopefully get people interested in converting all of these obscure Microsoft numbers back to 42 somehow by some cleverly fiendish calculations - not my very Primary School looking attempt!

It was something Jordan Peterson said about God which was very interesting. God is everything, Everywhere, Everywhen. God can create anything, is not limited by time, or space, absolutely no limits on God. ( maybe I should wait and post this tomorrow)

So what doesn't God have? - and the answer is is "Limitation" - We have limitations, and it's these limitations that actually makes life exciting and worth living. I'll hand you over to Jordan Peterson who explains haiku, a poetic form - 3 lines, and in total it's 17 syllables...

Jordan found it amusing and speaks about it in This podcast at around about 57 minutes in:-
The Jordan B. Peterson Podcast You have an Endless Potential


Extract:-
you know what a haiku is right it's this ridiculous poetic form that if you get 3 lines and I think in total it's 17 syllables and each line has to have a certain number of syllables I don't remember what it is and then there has to be accents in the right places as well because otherwise it's not a haiku and you might think well why in the world would you even bother doing something so ridiculous just write your damn 3 lines down and then go wash the dishes or do something useful but no there's a there's a challenge in that constraint it's right can you say something of poetic utility using this terrible constraint it's a challenge and so it's a challenge that you can rise to meet and so it's in gauging So it's engaging to rise to meet a challenge and so one of the sites that I used to spend some time on because it was so absurd was there's this archive online of haiku devoted to spam the luncheon meat.
59:13
Right and I think it's quite funny because there isn't anything that you can think of I don't think that is less likely to inspire poetic excess then spam right it's like it's it's way down there on the list of romantic substances and you know I think there's some $25000.00 haiku in the online spam haiku archive and so people you know they take this crazy restriction haiku and then they add this insane additional restriction to it and then what they produce is poetic humor it's a very funny site as you as you might exist might imagine So if you're looking to be stupidly amused one day you might want to go check it out


It is the limits we have that make life interesting just imagine being able to conjure up anything you wanted a house, a car, or that you could win at anything with hardly any effort. Just think what you lose when you don't have Limitations...
 
Last edited:

Users who are viewing this thread

Top Bottom