Full Version: Cannot add more controls to a form
UtterAccess Forums > Microsoft® Access > Access Forms
LittleViews
According to a warning, I cannot add any more controls to a form.
Is there a limit to what I can have on a form?
HAs I had just deleted some controls, there should be room to add more.
The warning says that the form can be renamed and possibly more controls can be added, but I don't understand the instructions. I tried renaming the form, then closing Access, then renaming the form to the original name, but I get the same warning.
Is there any way to get around this?
Karen
AJS
You can have 754 controls over the lifetime of the form. Unfortunately, deleting controls does not "free up" this count. However, the SaveAsText routine mentioned by khaos here will do the trick and "reset" the control count.
AJ
khaos
Try this . It will clear up the old controls you deleted for good. If that doesn't work meaning you actually have the maximum number of controls, 754 for access xp and I think access 2000 has the same limit, then you'll need to use subforms.
TH
Ken
LittleViews
As per the reference, I tried this in the immediate window:
pplication.saveastext acForm,"Objectname","C:\Windows\Desktop\Objectname.txt"
Oget an error message that reads "You canceled the previous operation"
Any clues?
LittleViews
Ooops ... I forgot to replace objectname. I just did the two cycles ... let's see what happens.
LittleViews
Bingo! It worked . . . boy, I'll put that in my personal Access Bible.
Thanks SOOOO much both of you!
Karen
khaos
You're welcome, glad to help. I have noticed that on occasion it fails on loadfromtext the 1st try, if that happens i always try it a 2nd time and it has never failed then.
LittleViews
Hi everyone . . .
Is you know, your suggestions were a complete success. I now have another issue which may be related.
Ocounted and appear to have about 350 controls on my form (it's a tabbed application), which should be under the max. I am also considering moving a number of fields to their own table, but for now, they shouldn't be causing me a lot of trouble.
For some reason, saving the VB code related to this form is now taking around 3 minutes.
I've used the suggestion in the above messages a few times just to make sure everything's ok. This is a radical difference from two days ago, where all saves were fast.
Do you have any ideas as to why this is happening?
Karen
khaos
You don't have name autocorrect turned on for the db do you? That can slow saves down. Also the more changes to vb you seem to make also slows down the save sometimes. For me though the biggest slowdown seems to be network traffic.
en
LittleViews
I don't know what "name autocorrect" is. And I'm working on a development db on my desktop. Can you give me more info?
khaos
Its in the db options, go to "tools" | "Options" | "General". The option appears on the general tab, uncheck "Track name autocorrect info".
TH
Ken
LittleViews
Ken ... many hugs from New York City to you. That did it!
That was that function doing?
Karen
khaos
It tries to keep track of object and field names in the database, if working properly it will propagate changes to the names through the database. Its kinda cool but in access 2000 and 2002 it slows down the db and without service packs can cause problems. I never use it myself because of the slowdown with saving. For access 2003 it was fixed and is now supposed to work well without any issues. I have 2003 at home but am too tired of access programming by the time I get out of work to play with it much. I'm sure there is a better explanation in the access help or on the ms site. My advice though is to always turn it off. You'll need to turn it off for each db as this option is db specific. I've noticed it occasionaly gets turned back on by service packs and also since my work machine was upgraded to windows 2000, must be permissions of some kind.
en
LittleViews
Ah! OK - that does it!
:-)
Karen
khaos
Glad to help, best of luck with your project.
bennyl23
Does anyone know if the control limit on a form applies when you're using the deletecontrol function?
I am adding and deleting controls through code to the same form, right now there's about 25 controls on it. Each time I run it, the controls on the form are deleted, then new ones are added. I did this about 40 times and did not receive an error. So I definitely went over 754, but no error.
Does deletecontrol get rid of the controls completely?
khaos
Are you doing this at runtime (form view)? If so the counts might not be saved as the form changes aren't saved from form view.
en
bennyl23
No, the form is open in design view, but hidden.
khaos
Well I'm going to say it must then, never used it myself. My users all have runtime so this just can't happen for me. The controls I must delete with that method are from the building of the app before a production version.
en
bennyl23
Hmmm, didn't even think about this program possibly being used in Access runtime in the future. So you're saying this won't work in runtime? Or maybe it just won't work in an MDE.
AJS
Access runtime cannot open a form in design view, hidden or not -- so DeleteControl is not an option. Don't know whether you can use it in an MDE file.
AJ
JVanKirk
Why do you need to delete controls and readd them?
bennyl23
It's for a form that uses a crosstab query. The data changes constantly in the crosstab, so before the form is opened in form view, I open it in design view, delete the necessary controls, add some new ones, and close out of design view. It's wierd, I know, but there's no other way to get the data the way I want it. It works like a charm, but I'll have to get rid of it if I ever use it in Access runtime.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.