Re: Out of Memory (Error 7) when adding a VBA function

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Allen -

Thanks for the rapid response and comprehensive troubleshooting method. As
noted above, Daniel's solution worked in this case, but I will run my
corrupted file through your methodology at first chance and will report back.

Many thanks,
Jay

"Allen Browne" wrote:

A decompile might fix this.

Try this standard sequence (in order):

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Open Access, and compact again.

5. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html

6. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.

At this point, you should have a database where the name-autocorrect errors
are gone, the indexes are repaired, inconsistencies between the text- and
compiled-versions of the code are fixed, and reference ambiguities are
resolved.

If it is still a problem, the next step would be to get Access to rebuild
the database for you. Follow the steps for the first symptom in this
article:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jay" <Jay@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3688CD34-CCAD-469A-996D-689FA8966D70@xxxxxxxxxxxxxxxx
Hi all -

WinXP/Access2003/All updates installed/2 GB of memory/Late model Dell PC.

I'm getting an unexpected "Out of memory" error when I try to add a new
function to a module. Pressing the [Help] button on this error dialog
informs me that the error number is “7” and suggests things like:
procedures
are too complex and the like, but I have built much more complex VB code
along with more modules than this in the past. I've been editing the file
for some time, adding code for new functions and procedures at will with
no
trouble. In fact, I’ve been building the file on two different PC’s with
no
trouble.

Today, for some reason, adding a new function resulted in the ‘out of
memory’ error (when I try to type “function test() and press enter). Note
that I can ocassionally add a new function, but only if its name does not
start with the same characters as an existing function. Also, I can add a
blank module or two, but then the same error occurs when trying to add a
third module. I can add statements to existing procedures and functions
with
no trouble.

My application is not overly complex; I have 3 modules each containing 1
to
3 procedures with a 4th module containing 10 fairly basic functions (each
function has 3 to 25 statements or so) and there are no other applications
running.

Any advice from others who have experienced this problem would be
appreciated,
Jay



.



Relevant Pages

  • Re: Click Function Problem - Code Help Required
    ... 60 odd queries in this database. ... what I need replaced with a valid function. ... Data member not found ... >I'm having trouble getting my message across on this one. ...
    (microsoft.public.access.forms)
  • Re: Help with default fields...
    ... Trouble Call database list that is designed so our operation manager can add ... Trouble Call database to reference that list. ... since it is the only one that will let me edit the entry (In other words, ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: ms access 2003
    ... The database seemed to have run out of job numbers for 2009. ... Now playing with it in 2010, it seems to be working again but obviously ... I have a database that is based on MS access that I am having trouble ... I actually paid someone to create this for me but they refuse help ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Looking for advice on how to get started
    ... least trouble) way is to put this into a database. ... be able to ruin the format of your data. ... Another matter is security. ...
    (comp.programming)