Kenneth Ismert
kismert at gmail.com
Tue Dec 13 17:26:20 CST 2011
> > Mark Simms: > But let me ask...for complex forms with a lot of controls in specific > positions and "tight registration"... > Isn't the manual rebuild a monumental task in some cases ? > > Charlotte Foust: > You might change your mind if you start writing code to copy the controls > over! ... I only built the code because ... I was building survey UIs on > a > daily basis. It wouldn't have been worth it otherwise. > I agree with Charlotte. You have to be strongly motivated to tackle this project. In my case, the company's flagship A2K product had a crippling case of bloat that none of the normal methods (including EatBloat) could cure. It took 3 months full-time to develop the 'complete rebuild' fix, which did finally work (to everyone's great relief)! Mark: if you are forced to rebuild a huge form, try these steps: 1. Rename all form controls with a default numeric suffix, like 'label123' and 'text234'. 2. In the Immediate window, count the number of controls: ? Forms("frmFoo").Controls.Count 2. Save the form as text: Application.SaveAsText acForm, "frmFoo", CurrentProject.Path & "\" & "Form_frmFoo.txt" 3. Edit "Form_frmFoo.txt" using a text editor. Find this attribute, and edit it to the number of controls +1: ItemSuffix =128 4. Backup your Access database. Delete the problem form. Compact & Repair. 5. Import the form using: Application.LoadFromText acForm, "frmFoo", CurrentProject.Path & "\" & "Form_frmFoo.txt" I have observed this to work. -Ken