MS Access‎ > ‎

MS Access crash on compilation

    A couple of reason why MS Access can hang or crash when developing an application. 
One frequent fix is a compress - repair. This can work in some case, but is usually temporary. What is the root cause of these crashes is often misunderstood by developer. One of the major cause of these crashes is that developer do not follow Microsoft guidelines when it comes to VBA module size.  Those module should not contain more than 20K characters as a general guidelines. They should also not contain more than 254 controls.

One frequent fix is a compress - repair. This can work in some case, but is usually temporary. What is the root cause of these crashes is often misunderstood by developer. One of the major cause of these crashes is that developer do not follow Microsoft guidelines when it comes to VBA module size.  Those module should not contain more than 20K characters as a general guidelines. They should also not contain more than 254 controls.


Therefore try to think of ways to split your bigger module into smaller one for more stability.


http://support.microsoft.com/kb/112860

    Minimize the number of controls on a form. The upper limit of controls on a form is 470; however, they can use only 254 control names (making control arrays necessary). In practice, a form this heavily laden with controls would be slow in performance. Minimize the number and type of custom controls on a given form.


and

    The module-level declaration section of each form or code module can also contain up to 64K of p-code. If the procedure-level or module-level p-code exceeds this limit, Visual Basic generates an "Out of Memory" error message. There is no specific internal limit to the total size of an individual form or code module. 


Comments