Subform going corrupt when adding a field (1 Viewer)

mafhobb

Registered User.
Local time
Today, 17:22
Joined
Feb 28, 2006
Messages
1,250
Hi.
I have a database that I have been using for a long time without any issues. Now, I need to add a field to a subform that loads with the main, starting form. When I add the field (simple txt) , save the subform and do a C&R (or not, that does not seem to make a difference) the db does not open correctly and I get a "do you want to start in Safe mode" message. Even if I start it in safe mode, the db crashes and does not open.
If I go back in (by pressing the shift key) and delete that new field from that subform, then C&R, the db and that subform opens fine.
I have also tried to add a label in that subform instead of a text field and the same thing happens
It seems like making changes to the subform corrupts that subform and removing them, removes the corruption.
What is happening?
 
Last edited:
Perhaps you have added and removed so many controls over time, you have reached the finite limit - used to be around 700

Suggest create a new form and copy all controls from the old form
 
Before rebuilding the entire Db, try just that form.
• Create new blank form • Copy/paste controls and code from dead form
• Delete dead form
• Now try add your new control.
 
Export a copy of the form to text then restore from text.

in the immediate window
Application.SaveAsText acForm, "MyForm", "C:\Exports\MyForm.txt"
Rename the form or delete it.
Application.LoadFromText acForm, "MyForm", "C:\Exports\MyForm.txt"
Now try to add the new control.
 
Are you changing the subform in design mode as a child of the main form or are you opening the subform on its own to make the update? I prefer to open the subform on its own.
 
Perhaps you have added and removed so many controls over time, you have reached the finite limit - used to be around 700

Suggest create a new form and copy all controls from the old form
I think that's unlikely as you get a warning message when you hit the lifetime limit for form controls.
For info, the limit is officially 754 but in practice is now at least 1038 (32-bit) or 1176 ((64-bit).

If you subform is getting corrupted then try decompiling your Access project. This will remove any corruption in your VBA code.
See https://isladogs.co.uk/command-line-switches/index.html
 

Users who are viewing this thread

Back
Top Bottom